Ejemplo n.º 1
0
        void ResetMainState()
        {
            MDataTable table = null;

            using (ProjectConfig config = new ProjectConfig())
            {
                table = config.Select();//更新其它的状态。
            }
            if (table.Rows.Count > 0)
            {
                foreach (MDataRow row in table.Rows)
                {
                    row.Set("IsMain", false);
                }
                table.AcceptChanges(AcceptOp.Update);
            }
        }
Ejemplo n.º 2
0
 void InitConfig()
 {
     using (ProjectConfig config = new ProjectConfig())
     {
         MDataTable dt = config.Select();
         if (dt.Rows.Count > 0)
         {
             foreach (MDataRow row in dt.Rows)
             {
                 ddlName.Items.Add(row.Get <string>("Name"));
                 if (row.Get <bool>("IsMain"))
                 {
                     ddlName.Text = row.Get <string>("Name");
                 }
             }
         }
         else
         {
             ddlName.Text = "DefaultConn";
         }
     }
 }