예제 #1
0
 private void DataCheck(DataRow row, FineUIPro.Form form, ref string msg)
 {
     foreach (FineUIPro.FormRow fr in form.Rows)
     {
         if (fr.Hidden)
         {
             continue;
         }
         foreach (Field cl in fr.Items)
         {
             if (cl is FineUIPro.TextBox)
             {
                 FineUIPro.TextBox tbx = (FineUIPro.TextBox)cl;
                 if (tbx.Text != row[tbx.ID.Substring(3)].ToString())
                 {
                     msg += string.Format("字段【{0}】由【{1}】变更为【{2}】;", tbx.Text + "_" + tbx.ID.Substring(3), row[tbx.ID.Substring(3)].ToString(), tbx.Text);
                 }
             }
             else if (cl is FineUIPro.DropDownList)
             {
                 FineUIPro.DropDownList ddl = (FineUIPro.DropDownList)cl;
                 if (ddl.SelectedValue != row[ddl.ID.Substring(3)].ToString())
                 {
                     msg += string.Format("字段【{0}】由【{1}】变更为【{2}】;", ddl.Text + "_" + ddl.ID.Substring(3), row[ddl.ID.Substring(3)].ToString(), ddl.SelectedValue);
                 }
             }
             else if (cl is FineUIPro.NumberBox)
             {
                 FineUIPro.NumberBox nbb = (FineUIPro.NumberBox)cl;
                 if (nbb.Text != row[nbb.ID.Substring(3)].ToString())
                 {
                     msg += string.Format("字段【{0}】由【{1}】变更为【{2}】;", nbb.Text + "_" + nbb.ID.Substring(3), row[nbb.ID.Substring(3)].ToString(), nbb.Text);
                 }
             }
             else if (cl is FineUIPro.DatePicker)
             {
                 FineUIPro.DatePicker dpk = (FineUIPro.DatePicker)cl;
                 if (dpk.Text != row[dpk.ID.Substring(3)].ToString())
                 {
                     msg += string.Format("字段【{0}】由【{1}】变更为【{2}】;", dpk.Text + "_" + dpk.ID.Substring(3), row[dpk.ID.Substring(3)].ToString(), dpk.Text);
                 }
             }
             else if (cl is FineUIPro.CheckBox)
             {
                 FineUIPro.CheckBox ckb = (FineUIPro.CheckBox)cl;
                 //row[ckb.ID.Substring(3)].ToString()
                 string strValue = ckb.Checked ? "Y" : "N";
                 if (row[ckb.ID.Substring(3)].ToString() != strValue)
                 {
                     msg += string.Format("字段【{0}】由【{1}】变更为【{2}】;", ckb.Text + "_" + ckb.ID.Substring(3), row[ckb.ID.Substring(3)].ToString(), strValue);
                 }
             }
         }
     }
 }
예제 #2
0
 private void formGet(Form formItms, DataRow row)
 {
     foreach (Control control in formItms.Controls)
     {
         foreach (Control item in control.Controls)
         {
             if (item is FineUIPro.TextBox)
             {
                 FineUIPro.TextBox txt = (FineUIPro.TextBox)item;
                 try
                 {
                     txt.Text = row[txt.ID.Substring(3)].ToString();
                 }
                 catch { }
             }
             else if (item is FineUIPro.DropDownList)
             {
                 FineUIPro.DropDownList ddl = (FineUIPro.DropDownList)item;
                 if (ddl.ID.Substring(3) == "TYPE")
                 {
                     ddl.SelectedValue = ddlType.SelectedValue;
                 }
                 else
                 {
                     try
                     {
                         ddl.SelectedValue = row[ddl.ID.Substring(3)].ToString();
                     }
                     catch { }
                 }
             }
             else if (item is FineUIPro.CheckBox)
             {
                 FineUIPro.CheckBox cbx = (FineUIPro.CheckBox)item; try
                 {
                     if (row[cbx.ID.Substring(3)].ToString() == "Y")
                     {
                         cbx.Checked = true;
                     }
                     else
                     {
                         cbx.Checked = false;
                     }
                 }
                 catch { }
             }
             else if (item is FineUIPro.NumberBox)
             {
                 FineUIPro.NumberBox num = (FineUIPro.NumberBox)item;
                 try
                 {
                     num.Text = row[num.ID.Substring(3)].ToString();
                 }
                 catch { }
             }
             else if (item is FineUIPro.DatePicker)
             {
                 FineUIPro.DatePicker date = (FineUIPro.DatePicker)item;
                 try
                 {
                     date.Text = row[date.ID.Substring(3)].ToString();
                 }
                 catch { }
             }
         }
     }
 }