提交当前本机整理版本
This commit is contained in:
@@ -34,6 +34,8 @@ namespace NewMyFormDesigner
|
||||
/// 密码
|
||||
/// </summary>
|
||||
public string Password { get; set; }
|
||||
//模块类别,1=单表,2=单据
|
||||
public int Modtype { get; set; }
|
||||
|
||||
|
||||
public DesignerControl dc { get; set; }
|
||||
@@ -62,26 +64,53 @@ namespace NewMyFormDesigner
|
||||
this.gridControl1.AutoGenerateColumns = false;
|
||||
|
||||
string LinkString = string.Empty;
|
||||
ConnectionType connectionType = ConnectionType.SqlServer;
|
||||
if (!string.IsNullOrWhiteSpace(ServerName) && !string.IsNullOrWhiteSpace(DatabaseName) && !string.IsNullOrWhiteSpace(AccountNumber) && !string.IsNullOrWhiteSpace(Password))
|
||||
{
|
||||
LinkString = string.Format("Server ={0}; Database ={1}; Persist Security Info = True; User ID ={2}; Password ={3}; Connection Timeout = 5; MultipleActiveResultSets = true",ServerName, DatabaseName, AccountNumber, Password);
|
||||
LinkString = string.Format("Server ={0}; Database ={1}; Persist Security Info = True; User ID ={2}; Password ={3}; Connection Timeout = 5; MultipleActiveResultSets = true", ServerName, DatabaseName, AccountNumber, Password);
|
||||
}
|
||||
|
||||
if (DBConfig.Instance.CreateConnection(LinkString))
|
||||
|
||||
//DialogResult dr = MessageBox.Show("是否为达梦数据库?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
//if (dr == System.Windows.Forms.DialogResult.Yes)
|
||||
//{
|
||||
// if (!string.IsNullOrWhiteSpace(ServerName) && !string.IsNullOrWhiteSpace(DatabaseName) && !string.IsNullOrWhiteSpace(AccountNumber))
|
||||
// {
|
||||
// string connect = "Nzg5REZBQ0IzMjYzQkQzRTZFRTExNjY5MThCNjUwQTVFRUQyMDMxQzI5REIwODY5REIwMkVCQzQ4MTMzRDhDNEU1N0JFREI0MDM3MTQ1MDZGQzdGOEQxQTE4MkQ2QzgyNEE4RkMzRDQzQUM4MzgyOEQ2REZERTIzQzBDMjJGQUE=";
|
||||
// string hostname = Environment.MachineName;
|
||||
// if (!string.IsNullOrWhiteSpace(Password))
|
||||
// {
|
||||
// LinkString = string.Format("Server={0}; schema={1}; UserId={2}; PWD={3};host={4}", ServerName, DatabaseName, AccountNumber, Password, hostname);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LinkString = string.Format(Lskj.Util.AESUtil.Decrypt(connect), ServerName, DatabaseName, AccountNumber, hostname);
|
||||
// }
|
||||
// connectionType = ConnectionType.DmServer;
|
||||
// }
|
||||
//}
|
||||
//MessageBox.Show(LinkString);
|
||||
|
||||
|
||||
if (DBConfig.Instance.CreateConnection(LinkString, connectionType))
|
||||
{
|
||||
//MessageBox.Show("1");
|
||||
InitData();
|
||||
DataTable dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemDlltab where formkey='{0}'", FrmKey));
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
this.DllCoid = dt.Rows[0]["DllCoid"] + "";
|
||||
this.Modtype = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systembilltype where formkey='{0}'", FrmKey));
|
||||
if(dt.Rows.Count>0) this.DllCoid = dt.Rows[0]["typeCode"] + "";
|
||||
this.Modtype = 2;
|
||||
}
|
||||
|
||||
}
|
||||
//MessageBox.Show("2");
|
||||
}
|
||||
|
||||
|
||||
@@ -194,10 +223,11 @@ namespace NewMyFormDesigner
|
||||
dc.Height = pModel.parentHeight;
|
||||
dc.Width = pModel.parentWidth;
|
||||
dc.AutoScroll = true;
|
||||
plRight.Controls.Add(dc);
|
||||
dc.Dock = DockStyle.Fill;
|
||||
plRight.AutoScroll = true;
|
||||
|
||||
plRight.Controls.Add(dc);
|
||||
|
||||
plRight.AutoScroll = true;
|
||||
dc.BringToFront();
|
||||
}
|
||||
|
||||
@@ -224,7 +254,7 @@ namespace NewMyFormDesigner
|
||||
ctr.Location = (new Point(posX, posY));//屏幕坐标转换成控件容器坐标
|
||||
ctr.Width = width;
|
||||
ctr.Height = height;
|
||||
ctr.TabIndex = tabOrder;
|
||||
ctr.TabIndex = tabOrder>=0? tabOrder:0;
|
||||
|
||||
ctr.Tag = new object[] { fieldid, username, fieldtypeid, fieldname, defaultValue, column_id, orderid, id };
|
||||
ctr.Parent = dc._hostFrame;
|
||||
@@ -286,6 +316,8 @@ namespace NewMyFormDesigner
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void gvFiled_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button != MouseButtons.Left)
|
||||
@@ -344,6 +376,7 @@ namespace NewMyFormDesigner
|
||||
RunForm runForm = new RunForm();
|
||||
runForm.FrmKey = FrmKey;
|
||||
runForm.DllCoid = DllCoid;
|
||||
runForm.Modtype = Modtype;
|
||||
//runForm.db = db;
|
||||
runForm.SQL = SelectSQL;
|
||||
runForm.ShowDialog();
|
||||
@@ -363,11 +396,11 @@ namespace NewMyFormDesigner
|
||||
DataTable formTheKey = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemControlParent where formkey='{0}'", FrmKey));
|
||||
if (formTheKey != null && formTheKey.Rows.Count > 0) //数据库中是否有这个模块
|
||||
{
|
||||
sql = " UPDATE p_systemControlParent set parentheight='" + dc._hostFrame.Height.ToString() + "',parentwidth='" + dc._hostFrame.Width.ToString() + "'where formkey='" + FrmKey + "'";
|
||||
sql = " UPDATE p_systemControlParent set parentheight='" + dc._hostFrame.Height.ToString() + "',parentwidth='" + dc._hostFrame.Width.ToString() + "'where formkey='" + FrmKey + "';";
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = " insert into p_systemControlParent (formkey,parentheight,parentwidth) values ('" + FrmKey + "'," + dc._hostFrame.Height.ToString() + "," + dc._hostFrame.Width.ToString() + ")";
|
||||
sql = " insert into p_systemControlParent (formkey,parentheight,parentwidth) values ('" + FrmKey + "'," + dc._hostFrame.Height.ToString() + "," + dc._hostFrame.Width.ToString() + ");";
|
||||
|
||||
}
|
||||
sqlbuild.Append(sql);
|
||||
@@ -379,7 +412,7 @@ namespace NewMyFormDesigner
|
||||
dtColumn.AcceptChanges();
|
||||
if ((dtColumn != null) && (dtColumn.Rows.Count > 0))
|
||||
{
|
||||
sql = " delete p_systemcontrolColumn where formkey='" + FrmKey + "'";
|
||||
sql = " delete p_systemcontrolColumn where formkey='" + FrmKey + "';";
|
||||
sqlbuild.Append(sql);
|
||||
foreach (DataRow row in dtColumn.Rows)
|
||||
{
|
||||
@@ -390,7 +423,7 @@ namespace NewMyFormDesigner
|
||||
,'{3}'
|
||||
,'{4}'
|
||||
,'{5}'
|
||||
,'{6}')", FrmKey, row["column_id"], row["controlLeft"], row["controlTop"], row["controlWidth"], row["controlHeight"], row["rowspace"]);
|
||||
,'{6}');", FrmKey, row["column_id"], row["controlLeft"], row["controlTop"], row["controlWidth"], row["controlHeight"], row["rowspace"]);
|
||||
sqlbuild.Append(sql);
|
||||
}
|
||||
}
|
||||
@@ -445,7 +478,7 @@ namespace NewMyFormDesigner
|
||||
cid = col[7].ToString();//当前控件的id
|
||||
if (IsNumberic(cid))
|
||||
{
|
||||
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemAddGroup where id='{0}'", cid));
|
||||
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemAddGroup where id='{0}';", cid));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -458,7 +491,7 @@ namespace NewMyFormDesigner
|
||||
,[controlHeight]='{3}'
|
||||
,[controlWidth]='{4}'
|
||||
,[formKey]='{5}'
|
||||
,[controlType]='{6}',[borderColor]='{8}',[titlePosition]='{9}' where id='{7}'
|
||||
,[controlType]='{6}',[borderColor]='{8}',[titlePosition]='{9}' where id='{7}';
|
||||
", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 333, cid, colorHtml, TitlePosition) :
|
||||
String.Format(@"UPDATE p_systemAddGroup set
|
||||
[GroupName]='{0}'
|
||||
@@ -467,7 +500,7 @@ namespace NewMyFormDesigner
|
||||
,[controlHeight]='{3}'
|
||||
,[controlWidth]='{4}'
|
||||
,[formKey]='{5}'
|
||||
,[controlType]='{6}' where id='{7}'
|
||||
,[controlType]='{6}' where id='{7}';
|
||||
", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 333, cid);
|
||||
}
|
||||
else
|
||||
@@ -487,7 +520,7 @@ namespace NewMyFormDesigner
|
||||
,'{3}'
|
||||
,'{4}'
|
||||
,'{5}'
|
||||
,'{6}','{7}','{8}')", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 333, colorHtml, TitlePosition) :
|
||||
,'{6}','{7}','{8}');", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 333, colorHtml, TitlePosition) :
|
||||
String.Format(@"INSERT INTO [p_systemAddGroup]
|
||||
([GroupName]
|
||||
,[controlLeft]
|
||||
@@ -503,7 +536,7 @@ namespace NewMyFormDesigner
|
||||
,'{3}'
|
||||
,'{4}'
|
||||
,'{5}'
|
||||
,'{6}')", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 333);
|
||||
,'{6}');", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 333);
|
||||
}
|
||||
sqlbuild.Append(sql);
|
||||
}
|
||||
@@ -518,7 +551,7 @@ namespace NewMyFormDesigner
|
||||
cid = col[7].ToString();//当前控件的id
|
||||
if (IsNumberic(cid))
|
||||
{
|
||||
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemAddGroup where id='{0}'", cid));
|
||||
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemAddGroup where id='{0}';", cid));
|
||||
}
|
||||
}
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
@@ -530,7 +563,7 @@ namespace NewMyFormDesigner
|
||||
,[controlHeight]='{3}'
|
||||
,[controlWidth]='{4}'
|
||||
,[formKey]='{5}'
|
||||
,[controlType]='{6}' where id='{7}'
|
||||
,[controlType]='{6}' where id='{7}';
|
||||
", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 332, cid);
|
||||
}
|
||||
else
|
||||
@@ -550,7 +583,7 @@ namespace NewMyFormDesigner
|
||||
,'{3}'
|
||||
,'{4}'
|
||||
,'{5}'
|
||||
,'{6}')", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 332);
|
||||
,'{6}');", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 332);
|
||||
}
|
||||
sqlbuild.Append(sql);
|
||||
}
|
||||
@@ -565,7 +598,7 @@ namespace NewMyFormDesigner
|
||||
cid = col[7].ToString();//当前控件的id
|
||||
if (IsNumberic(cid))
|
||||
{
|
||||
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemAddGroup where id='{0}'", cid));
|
||||
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemAddGroup where id='{0}';", cid));
|
||||
}
|
||||
}
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
@@ -577,7 +610,7 @@ namespace NewMyFormDesigner
|
||||
,[controlHeight]='{3}'
|
||||
,[controlWidth]='{4}'
|
||||
,[formKey]='{5}'
|
||||
,[controlType]='{6}' where id='{7}'
|
||||
,[controlType]='{6}' where id='{7}';
|
||||
", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 334, cid);
|
||||
}
|
||||
else
|
||||
@@ -597,14 +630,14 @@ namespace NewMyFormDesigner
|
||||
,'{3}'
|
||||
,'{4}'
|
||||
,'{5}'
|
||||
,'{6}')", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 334);
|
||||
,'{6}');", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 334);
|
||||
}
|
||||
sqlbuild.Append(sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sqlbuild.Append(string.Format(" delete p_systemControlLocation where formkey='{0}'", FrmKey));
|
||||
sqlbuild.Append(string.Format(" delete p_systemControlLocation where formkey='{0}';", FrmKey));
|
||||
foreach (DataRow row in dtFiled.Rows)
|
||||
{
|
||||
//MessageBox.Show(row["fieldName"].ToString());
|
||||
@@ -623,7 +656,7 @@ namespace NewMyFormDesigner
|
||||
if (tags.Length >= 9)
|
||||
{
|
||||
ControlProperty controlProperty = tags[tags.Length - 1] as ControlProperty;
|
||||
String group_sql = string.Format("select * from p_systemAddGroup where formkey='{0}' and groupName='{1}'", FrmKey, controlProperty.GroupName);
|
||||
String group_sql = string.Format("select * from p_systemAddGroup where formkey='{0}' and groupName='{1}';", FrmKey, controlProperty.GroupName);
|
||||
DataTable dtsql = SqlHelper.ExecuteDataSet(group_sql).Tables[0];
|
||||
if (dtsql != null && dtsql.Rows.Count > 0)
|
||||
{
|
||||
@@ -678,7 +711,7 @@ namespace NewMyFormDesigner
|
||||
model.GroupId.ToString() + "," +
|
||||
ctr.TabIndex.ToString() + "," +
|
||||
tags[5].ToString() + "," +
|
||||
tags[6].ToString() + ")";
|
||||
tags[6].ToString() + ");";
|
||||
sqlbuild.Append(sql);
|
||||
//ldao.Add(model);
|
||||
}
|
||||
@@ -689,14 +722,16 @@ namespace NewMyFormDesigner
|
||||
MessageBox.Show(row["username"].ToString());
|
||||
}
|
||||
|
||||
sqlbuild.Append(updateSQL);
|
||||
//sqlbuild.Append(updateSQL);
|
||||
}
|
||||
sqlbuild.Append(updateSQL);
|
||||
SqlHelper.ExecuteNonQuery(sqlbuild.ToString());
|
||||
MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
System.Windows.Forms.Clipboard.SetText(ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -760,11 +795,11 @@ namespace NewMyFormDesigner
|
||||
StringBuilder sqlbuild = new StringBuilder();
|
||||
if (dc._overlayer._currentCtrl is LabelGroupBox || dc._overlayer._currentCtrl is Panel || dc._overlayer._currentCtrl is LabelDivider)
|
||||
{
|
||||
sql = "delete from p_systemAddGroup where id='" + id + "'";
|
||||
sql = "delete from p_systemAddGroup where id='" + id + "';";
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "delete from p_systemcontrollocation where id='" + id + "'";
|
||||
sql = "delete from p_systemcontrollocation where id='" + id + "';";
|
||||
}
|
||||
sqlbuild.Append(sql);
|
||||
sqlbuild.Append(updateSQL);
|
||||
@@ -1335,6 +1370,8 @@ namespace NewMyFormDesigner
|
||||
DialogResult dlrg = MessageBox.Show("是否对全部控件的Tab进行批量调整?", "询问", MessageBoxButtons.YesNo);
|
||||
if (dlrg != DialogResult.Yes)
|
||||
return;
|
||||
|
||||
//int value = 1;
|
||||
foreach (DataRow dr in dt.Rows)
|
||||
{
|
||||
if (dr == null)
|
||||
@@ -1350,7 +1387,6 @@ namespace NewMyFormDesigner
|
||||
continue;
|
||||
}
|
||||
ctr[0].TabIndex = value;
|
||||
|
||||
//点击保存时去修改
|
||||
//try
|
||||
//{
|
||||
@@ -1360,7 +1396,7 @@ namespace NewMyFormDesigner
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
//}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user