Пример #1
0
        public string DoType(string doType, string v1, string v2, string v3, string v4, string v5)
        {
            try
            {
                switch (doType)
                {
                case "AdminLogin":
                    try
                    {
                        Emp emp = new Emp();
                        emp.No = v1;
                        emp.RetrieveFromDBSources();
                        if (emp.Pass == v2)
                        {
                            return(null);
                        }
                        return("error password.");
                    }
                    catch (Exception ex)
                    {
                        return(ex.Message);
                    }

                case "DeleteFrmSort":
                    FrmSort fs = new FrmSort();
                    fs.No = v1;
                    fs.Delete();
                    return(null);

                case "DeleteFrm":
                case "DelFrm":
                    MapData md = new MapData();
                    md.No = v1;
                    md.Delete();
                    return(null);

                case "InitDesignerXml":
                    string  path = BP.SystemConfig.PathOfData + "\\Xml\\Designer.xml";
                    DataSet ds   = new DataSet();
                    ds.ReadXml(path);
                    ds = this.TurnXmlDataSet2SLDataSet(ds);
                    return(Connector.ToXml(ds));

                default:
                    throw new Exception("没有判断的,功能编号" + doType);
                }
            }
            catch (Exception ex)
            {
                BP.DA.Log.DefaultLogWriteLineError("执行错误,功能编号" + doType + " error:" + ex.Message);
                throw new Exception("执行错误,功能编号" + doType + " error:" + ex.Message);
            }
        }
Пример #2
0
 void btn_SaveFrmSort_Click(object sender, EventArgs e)
 {
     for (int i = 1; i <= 15; i++)
     {
         TextBox tbName = this.Pub1.GetTextBoxByID("TB_Name_" + i);
         FrmSort fs     = new FrmSort();
         fs.No   = i.ToString().PadLeft(2, '0');
         fs.Name = tbName.Text.ToString();
         if (fs.Name.Length > 1)
         {
             fs.Save();
         }
         else
         {
             fs.Delete();
         }
     }
     this.Alert("保存成功");
 }