當前位置: 首頁>>代碼示例>>C#>>正文


C# SettingsSP.SettingsToCopyViewAll方法代碼示例

本文整理匯總了C#中Open_Miracle.SettingsSP.SettingsToCopyViewAll方法的典型用法代碼示例。如果您正苦於以下問題:C# SettingsSP.SettingsToCopyViewAll方法的具體用法?C# SettingsSP.SettingsToCopyViewAll怎麽用?C# SettingsSP.SettingsToCopyViewAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Open_Miracle.SettingsSP的用法示例。


在下文中一共展示了SettingsSP.SettingsToCopyViewAll方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: FillDefaultSettings

 /// <summary>
 /// RESET DATA FROM TABLE SETTINGSCOPY
 /// </summary>
 public void FillDefaultSettings()
 {
     SettingsSP spSettings = new SettingsSP();
     DataTable dtbl = new DataTable();
     try
     {
         dtbl = spSettings.SettingsToCopyViewAll();
         foreach (Control ctrl in this.Controls)
         {
             if (ctrl is CheckBox)
             {
                 CheckBox cb = (CheckBox)ctrl;
                 strControlls = cb.Text.Replace(" ", string.Empty);
                 foreach (DataRow dr in dtbl.Rows)
                 {
                     if (dr["settingsName"].ToString() == strControlls)
                     {
                         if (strControlls == "AllowGoDown")
                         {
                             if (dr["status"].ToString() == "Yes")
                             {
                                 cb.Checked = true;
                                 if (spSettings.SettingsStatusCheck("AllowRack") == "Yes")
                                 {
                                     cbxAllowRack.Checked = true;
                                 }
                                 else
                                 {
                                     cbxAllowRack.Checked = false;
                                 }
                             }
                             else if (dr["status"].ToString() == "No")
                             {
                                 cb.Checked = false;
                                 cbxAllowRack.Visible = false;
                                 cbxAllowRack.Checked = false;
                             }
                         }
                         else if (strControlls == "AddConfirmationFor")
                         {
                             if (dr["status"].ToString() == "Yes")
                             {
                                 cb.Checked = true;
                                 foreach (Control c in this.Controls)
                                 {
                                     if (c is CheckBox)
                                     {
                                         CheckBox cbx = (CheckBox)c;
                                         string str = cbx.Text.Replace(" ", string.Empty);
                                         if (str == "Add" || str == "Edit" || str == "Delete" || str == "Close")
                                         {
                                             foreach (DataRow dr1 in dtbl.Rows)
                                             {
                                                 if (dr1["settingsName"].ToString() == str)
                                                 {
                                                     if (dr1["status"].ToString() == "Yes")
                                                     {
                                                         cbx.Checked = true;
                                                     }
                                                     else if (dr1["status"].ToString() == "No")
                                                     {
                                                         cbx.Checked = false;
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                             else
                             {
                                 cb.Checked = false;
                                 cbxAdd.Visible = false;
                                 cbxDelete.Visible = false;
                                 cbxEdit.Visible = false;
                                 cbxClose.Visible = false;
                             }
                         }
                         else
                         {
                             if (dr["status"].ToString() == "Yes")
                             {
                                 cb.Checked = true;
                             }
                             else if (dr["status"].ToString() == "No")
                             {
                                 cb.Checked = false;
                             }
                         }
                     }
                 }
             }
             else if (ctrl is ComboBox)
             {
                 ComboBox cmb = (ComboBox)ctrl;
                 strControlls = ctrl.Name.Replace("cmb", string.Empty);
                 foreach (DataRow dr in dtbl.Rows)
//.........這裏部分代碼省略.........
開發者ID:jsoques,項目名稱:openmiracle,代碼行數:101,代碼來源:frmSettings.cs


注:本文中的Open_Miracle.SettingsSP.SettingsToCopyViewAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。