Example #1
0
        /// <summary>
        /// 获取类型设置
        /// <param name="typeCode">类型编号</param>
        /// <param name="tableName">使用表名</param>
        /// </summary>
        /// <returns>类型设置对象</returns>
        public TBType Get(string typeCode, string tableName)
        {
            TBType tbType = null;

            try
            {
                string strSQL = "select * from TBType where typeCode=:typeCode and tableName=:tableName";
                Param  param  = new Param();
                param.Clear();
                param.Add(":typeCode", typeCode);
                param.Add(":tableName", tableName);
                db.Open();
                ComDataReader dr = db.ExecuteReader(CommandType.Text, strSQL, param);
                if (dr.Read())
                {
                    tbType = ReadData(dr);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                db.Close();
            }
            return(tbType);
        }
Example #2
0
 public BPTextBox(TBType ty, string tbName)
 {
     this.NameOfReal = tbName;
     this.Name       = tbName;
     // "TB" + DateTime.Now.ToString("yyMMddhhmmss");
     this.HisTBType = ty;
     this.InitType();
 }
Example #3
0
        /// <summary>
        /// 读取类型设置信息
        /// <param name="dr">记录指针</param>
        /// </summary>
        /// <returns>类型设置对象</returns>
        private TBType ReadData(ComDataReader dr)
        {
            TBType tbType = new TBType();

            tbType.typeCode  = dr["typeCode"].ToString();  //类型编号
            tbType.tableName = dr["tableName"].ToString(); //使用表名
            tbType.typeName  = dr["typeName"].ToString();  //类型名称
            tbType.isUse     = dr["isUse"].ToString();     //使用状态
            return(tbType);
        }
Example #4
0
        public BPTextBox(TBType ty)
        {
            Adjust adjust = new Adjust();

            adjust.Bind(this);
            this.BindDrag();
            this.Name      = "TB" + DateTime.Now.ToString("yyMMddhhmmss");
            this.HisTBType = ty;
            this.InitType();
        }
Example #5
0
        public BPTextBox(TBType ty, string tbName)
        {
            Adjust adjust = new Adjust();

            adjust.Bind(this);
            this.BindDrag();
            this.NameOfReal = tbName;
            this.Name       = tbName;
            this.HisTBType  = ty;
            this.InitType();
        }
Example #6
0
        /// <summary>
        /// 修改类型设置
        /// <param name="data">数据库连接</param>
        /// <param name="tbType">类型设置</param>
        /// </summary>
        public void Edit(DataAccess data, TBType tbType)
        {
            string strSQL = "update TBType set typeName=:typeName,isUse=:isUse where typeCode=:typeCode and tableName=:tableName";
            Param  param  = new Param();

            param.Clear();
            param.Add(":typeName", tbType.typeName);   //类型名称
            param.Add(":isUse", tbType.isUse);         //使用状态
            param.Add(":typeCode", tbType.typeCode);   //类型编号
            param.Add(":tableName", tbType.tableName); //使用表名
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
Example #7
0
        private DataAccess db = new DataAccess(DataAccess.DBConn);//数据库连接

        #region 代码生成器自动生成


        /// <summary>
        /// 增加类型设置
        /// <param name="data">数据库连接</param>
        /// <param name="tbType">类型设置</param>
        /// </summary>
        public void Add(DataAccess data, TBType tbType)
        {
            string strSQL = "insert into TBType (typeCode,tableName,typeName,isUse) values (:typeCode,:tableName,:typeName,:isUse)";
            Param  param  = new Param();

            param.Clear();
            param.Add(":typeCode", tbType.typeCode);   //类型编号
            param.Add(":tableName", tbType.tableName); //使用表名
            param.Add(":typeName", tbType.typeName);   //类型名称
            param.Add(":isUse", tbType.isUse);         //使用状态
            data.ExecuteNonQuery(CommandType.Text, strSQL, param);
        }
Example #8
0
 /// <summary>
 /// 加载指定类型设置
 /// <param name="typeCode">类型编号</param>
 /// <param name="tableName">使用表名</param>
 /// </summary>
 public void Load(string typeCode, string tableName)
 {
     try
     {
         TBType tbType = tbTypeDAO.Get(typeCode, tableName);
         WebJson.ToJson(context, tbType);
     }
     catch (Exception e)
     {
         Message.error(context, e.Message);
     }
 }
        private void fillInfoType()
        {
            TBTypeService tbService = new TBTypeService();
            ArrayList     list      = tbService.GetTBTypeList();
            TBType        temp      = new TBType();

            temp.Id        = 0;
            temp.TypeIntro = "全部信息";
            list.Insert(0, temp);
            DropDownList_Type.DataSource     = list;
            DropDownList_Type.DataTextField  = "TypeIntro";
            DropDownList_Type.DataValueField = "Id";
            DropDownList_Type.DataBind();
        }
Example #10
0
 /// <summary>
 /// 修改类型设置
 /// <param name="tbType">类型设置</param>
 /// </summary>
 public void Edit(TBType tbType)
 {
     try
     {
         tbTypeDAO.Edit(tbType);
         Message.success(context, "类型设置修改成功");
         loginSession.Log("XXXXXX类型设置修改成功");
     }
     catch (Exception e)
     {
         Message.error(context, "类型设置修改失败");
         loginSession.Log(e.Message);
     }
 }
Example #11
0
        /// <summary>
        /// 获取数据库数据
        /// </summary>
        /// <returns></returns>
        public ArrayList GetTBTypeList()
        {
            ArrayList list = new ArrayList();
            string    sql  = "select * from tb_type";
            DataTable dt   = DBHelper.GetDataTable(sql);

            foreach (DataRow dr in dt.Rows)
            {
                TBType tb = new TBType();
                tb.Id        = Convert.ToInt32(dr["id"]);
                tb.TypeIntro = dr["type_intro"].ToString();
                list.Add(tb);
            }
            return(list);
        }
Example #12
0
 /// <summary>
 /// 修改类型设置
 /// <param name="tbType">类型设置</param>
 /// </summary>
 public void Edit(TBType tbType)
 {
     try
     {
         db.Open();
         Edit(db, tbType);
     }
     catch (Exception e)
     {
         throw e;
     }
     finally
     {
         db.Close();
     }
 }
Example #13
0
 /// <summary>
 /// 增加类型设置
 /// <param name="tbType">类型设置</param>
 /// </summary>
 public virtual void Add(TBType tbType)
 {
     try
     {
         db.Open();
         Add(db, tbType);
     }
     catch (Exception e)
     {
         throw e;
     }
     finally
     {
         db.Close();
     }
 }
Example #14
0
        protected void AddTBString(string key, string field, object defaultVal,
                                   FieldType _FieldType, TBType tbType, string desc, bool uiVisable, bool isReadonly, int minLength, int maxLength, int tbWith)
        {
            Attr attr = new Attr();

            attr.Key          = key;
            attr.Field        = field;
            attr.DefaultVal   = defaultVal;
            attr.MyDataType   = DataType.AppString;
            attr.Desc         = desc;
            attr.UITBShowType = tbType;
            attr.UIVisible    = uiVisable;
            attr.UIWidth      = tbWith;
            attr.UIIsReadonly = isReadonly;
            attr.MaxLength    = maxLength;
            attr.MinLength    = minLength;
            attr.MyFieldType  = _FieldType;
            this.Add(attr);
        }
Example #15
0
 public BPTextBox(TBType ty)
 {
     this.Name      = "TB" + DateTime.Now.ToString("yyMMddhhmmss");
     this.HisTBType = ty;
     this.InitType();
 }
Example #16
0
        /// <summary>
        /// 绑定表单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void BindFrm(object sender, FF.GenerWorkNodeCompletedEventArgs e)
        {
            #region 初始化数据.
            this.canvasMain.Children.Clear();
            this.FrmDS = new DataSet();
            try
            {
                if (e.Result.Length < 200)
                {
                    throw new Exception(e.Result);
                }
                this.FrmDS.FromXml(e.Result);
                loadingWindow.DialogResult = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Err", MessageBoxButton.OK);
                loadingWindow.DialogResult = true;
                return;
            }
            #endregion 初始化数据.

            this.InitToolbar();

            string table = "";
            try
            {
                this.dtMapAttrs = this.FrmDS.Tables["Sys_MapAttr"];
                foreach (DataTable dt in this.FrmDS.Tables)
                {
                    Glo.TempVal = dt.TableName;
                    table       = dt.TableName;
                    switch (dt.TableName)
                    {
                    case "Sys_MapAttr":
                        foreach (DataRow dr in dt.Rows)
                        {
                            if (dr["UIVisible"] == "0")
                            {
                                continue;
                            }

                            if (dr["FK_MapData"] != Glo.FK_MapData)
                            {
                                continue;
                            }

                            string myPk          = dr["MyPK"];
                            string FK_MapData    = dr["FK_MapData"];
                            string keyOfEn       = dr["KeyOfEn"];
                            string name          = dr["Name"];
                            string defVal        = dr["DefVal"];
                            string UIContralType = dr["UIContralType"];
                            string MyDataType    = dr["MyDataType"];
                            string lgType        = dr["LGType"];
                            bool   isEnable      = false;
                            if (dr["UIIsEnable"].ToString() == "1")
                            {
                                isEnable = true;
                            }

                            double X = double.Parse(dr["X"]);
                            double Y = double.Parse(dr["Y"]);
                            if (X == 0)
                            {
                                X = 100;
                            }
                            if (Y == 0)
                            {
                                Y = 100;
                            }

                            string UIBindKey = dr["UIBindKey"];
                            switch (UIContralType)
                            {
                            case CtrlType.TextBox:
                                TBType tp = TBType.String;
                                switch (MyDataType)
                                {
                                case DataType.AppInt:
                                    tp = TBType.Int;
                                    break;

                                case DataType.AppFloat:
                                case DataType.AppDouble:
                                    tp = TBType.Float;
                                    break;

                                case DataType.AppMoney:
                                    tp = TBType.Money;
                                    break;

                                case DataType.AppString:
                                    tp = TBType.String;
                                    break;

                                case DataType.AppDateTime:
                                    tp = TBType.DateTime;
                                    break;

                                case DataType.AppDate:
                                    tp = TBType.Date;
                                    break;

                                default:
                                    break;
                                }

                                BPTextBox tb = new BPTextBox(tp);
                                tb.NameOfReal = keyOfEn;
                                tb.Name       = keyOfEn;
                                tb.SetValue(Canvas.LeftProperty, X);
                                tb.SetValue(Canvas.TopProperty, Y);

                                tb.Text  = this.GetValByKey(keyOfEn);        //给控件赋值.
                                tb.Width = double.Parse(dr["UIWidth"]);

                                if (tb.Height > 24)
                                {
                                    tb.TextWrapping = TextWrapping.Wrap;
                                }

                                tb.Height = double.Parse(dr["UIHeight"]);

                                if (isEnable)
                                {
                                    tb.IsEnabled = true;
                                }
                                else
                                {
                                    tb.IsEnabled = false;
                                }
                                this.canvasMain.Children.Add(tb);
                                break;

                            case CtrlType.DDL:
                                BPDDL ddl = new BPDDL();
                                ddl.Name      = keyOfEn;
                                ddl.HisLGType = lgType;
                                ddl.Width     = double.Parse(dr["UIWidth"]);
                                ddl.UIBindKey = UIBindKey;
                                ddl.HisLGType = lgType;
                                if (lgType == LGType.Enum)
                                {
                                    DataTable dtEnum = this.FrmDS.Tables["Sys_Enum"];
                                    foreach (DataRow drEnum in dtEnum.Rows)
                                    {
                                        if (drEnum["EnumKey"].ToString() != UIBindKey)
                                        {
                                            continue;
                                        }

                                        ListBoxItem li = new ListBoxItem();
                                        li.Tag     = drEnum["IntKey"].ToString();
                                        li.Content = drEnum["Lab"].ToString();
                                        ddl.Items.Add(li);
                                    }
                                    if (ddl.Items.Count == 0)
                                    {
                                        throw new Exception("@没有从Sys_Enum中找到编号为(" + UIBindKey + ")的枚举值。");
                                    }
                                }
                                else
                                {
                                    ddl.BindEns(UIBindKey);
                                }

                                ddl.SetValue(Canvas.LeftProperty, X);
                                ddl.SetValue(Canvas.TopProperty, Y);

                                //给控件赋值.
                                ddl.SetSelectVal(this.GetValByKey(keyOfEn));

                                this.canvasMain.Children.Add(ddl);
                                break;

                            case CtrlType.CheckBox:
                                BPCheckBox cb = new BPCheckBox();
                                cb.Name    = keyOfEn;
                                cb.Content = name;

                                Label cbLab = new Label();
                                cbLab.Name    = "CBLab" + cb.Name;
                                cbLab.Content = name;
                                cbLab.Tag     = keyOfEn;
                                cb.Content    = cbLab;

                                cb.SetValue(Canvas.LeftProperty, X);
                                cb.SetValue(Canvas.TopProperty, Y);

                                if (this.GetValByKey(keyOfEn) == "1")
                                {
                                    cb.IsChecked = true;
                                }
                                else
                                {
                                    cb.IsChecked = false;
                                }
                                this.canvasMain.Children.Add(cb);
                                break;

                            case CtrlType.RB:
                                break;

                            default:
                                break;
                            }
                        }
                        continue;

                    case "Sys_FrmRB":
                        DataTable dtRB = this.FrmDS.Tables["Sys_FrmRB"];
                        foreach (DataRow dr in dtRB.Rows)
                        {
                            if (dr["FK_MapData"] != Glo.FK_MapData)
                            {
                                continue;
                            }

                            BPRadioBtn btn = new BPRadioBtn();
                            btn.Name      = dr["MyPK"];
                            btn.GroupName = dr["KeyOfEn"];
                            btn.Content   = dr["Lab"];
                            btn.UIBindKey = dr["EnumKey"];
                            btn.Tag       = dr["IntKey"];
                            btn.SetValue(Canvas.LeftProperty, double.Parse(dr["X"].ToString()));
                            btn.SetValue(Canvas.TopProperty, double.Parse(dr["Y"].ToString()));
                            this.canvasMain.Children.Add(btn);
                        }
                        continue;

                    case "Sys_MapDtl":
                        foreach (DataRow dr in dt.Rows)
                        {
                            BPDtl dtl = new BPDtl(dr["No"], this.FrmDS);
                            dtl.SetValue(Canvas.LeftProperty, double.Parse(dr["X"]));
                            dtl.SetValue(Canvas.TopProperty, double.Parse(dr["Y"]));
                            dtl.Width  = double.Parse(dr["W"]);
                            dtl.Height = double.Parse(dr["H"]);
                            this.canvasMain.Children.Add(dtl);
                        }
                        continue;

                    case "Sys_FrmEle":
                        foreach (DataRow dr in dt.Rows)
                        {
                            if (dr["FK_MapData"] != Glo.FK_MapData)
                            {
                                continue;
                            }

                            BPEle img = new BPEle();
                            img.Name    = dr["MyPK"].ToString();
                            img.EleType = dr["EleType"].ToString();
                            img.EleName = dr["EleName"].ToString();
                            img.EleID   = dr["EleID"].ToString();

                            img.Cursor = Cursors.Hand;
                            img.SetValue(Canvas.LeftProperty, double.Parse(dr["X"].ToString()));
                            img.SetValue(Canvas.TopProperty, double.Parse(dr["Y"].ToString()));

                            img.Width  = double.Parse(dr["W"].ToString());
                            img.Height = double.Parse(dr["H"].ToString());
                            this.canvasMain.Children.Add(img);
                        }
                        continue;

                    case "Sys_MapData":
                        if (dt.Rows.Count == 0)
                        {
                            continue;
                        }
                        foreach (DataRow dr in dt.Rows)
                        {
                            if (dr["No"] != Glo.FK_MapData)
                            {
                                continue;
                            }

                            Glo.HisMapData      = new MapData();
                            Glo.HisMapData.FrmH = double.Parse(dt.Rows[0]["FrmH"]);
                            Glo.HisMapData.FrmW = double.Parse(dt.Rows[0]["FrmW"]);
                            Glo.HisMapData.No   = (string)dt.Rows[0]["No"];
                            Glo.HisMapData.Name = (string)dt.Rows[0]["Name"];
                            // Glo.IsDtlFrm = false;
                            this.canvasMain.Width    = Glo.HisMapData.FrmW;
                            this.canvasMain.Height   = Glo.HisMapData.FrmH;
                            this.scrollViewer1.Width = Glo.HisMapData.FrmW;
                        }
                        break;

                    case "Sys_FrmBtn":
                        foreach (DataRow dr in dt.Rows)
                        {
                            if (dr["FK_MapData"] != Glo.FK_MapData)
                            {
                                continue;
                            }

                            BPBtn btn = new BPBtn();
                            btn.Name         = dr["MyPK"];
                            btn.Content      = dr["Text"].Replace("&nbsp;", " ");
                            btn.HisBtnType   = (BtnType)int.Parse(dr["BtnType"]);
                            btn.HisEventType = (EventType)int.Parse(dr["EventType"]);

                            if (dr["EventContext"] != null)
                            {
                                btn.EventContext = dr["EventContext"].Replace("~", "'");
                            }

                            if (dr["MsgErr"] != null)
                            {
                                btn.MsgErr = dr["MsgErr"].Replace("~", "'");
                            }

                            if (dr["MsgOK"] != null)
                            {
                                btn.MsgOK = dr["MsgOK"].Replace("~", "'");
                            }

                            btn.SetValue(Canvas.LeftProperty, double.Parse(dr["X"]));
                            btn.SetValue(Canvas.TopProperty, double.Parse(dr["Y"]));
                            this.canvasMain.Children.Add(btn);
                        }
                        continue;

                    case "Sys_FrmLine":
                        foreach (DataRow dr in dt.Rows)
                        {
                            if (dr["FK_MapData"] != Glo.FK_MapData)
                            {
                                continue;
                            }

                            string color = dr["BorderColor"];
                            if (string.IsNullOrEmpty(color))
                            {
                                color = "Black";
                            }

                            BPLine myline = new BPLine(dr["MyPK"], color, double.Parse(dr["BorderWidth"]),
                                                       double.Parse(dr["X1"]), double.Parse(dr["Y1"]), double.Parse(dr["X2"]),
                                                       double.Parse(dr["Y2"]));

                            myline.SetValue(Canvas.LeftProperty, double.Parse(dr["X"]));
                            myline.SetValue(Canvas.TopProperty, double.Parse(dr["Y"]));
                            this.canvasMain.Children.Add(myline);
                        }
                        continue;

                    case "Sys_FrmLab":
                        foreach (DataRow dr in dt.Rows)
                        {
                            if (dr["FK_MapData"] != Glo.FK_MapData)
                            {
                                continue;
                            }

                            BPLabel lab = new BPLabel();
                            lab.Name = dr["MyPK"];
                            string text = dr["Text"].Replace("&nbsp;", " ");
                            text         = text.Replace("@", "\n");
                            lab.Content  = text;
                            lab.FontSize = double.Parse(dr["FontSize"]);
                            lab.Cursor   = Cursors.Hand;
                            lab.SetValue(Canvas.LeftProperty, double.Parse(dr["X"]));
                            lab.SetValue(Canvas.TopProperty, double.Parse(dr["Y"]));

                            if (dr["IsBold"] == "1")
                            {
                                lab.FontWeight = FontWeights.Bold;
                            }
                            else
                            {
                                lab.FontWeight = FontWeights.Normal;
                            }

                            string color = dr["FontColor"];
                            lab.Foreground = new SolidColorBrush(Glo.ToColor(color));
                            this.canvasMain.Children.Add(lab);
                        }
                        continue;

                    case "Sys_FrmLink":
                        foreach (DataRow dr in dt.Rows)
                        {
                            if (dr["FK_MapData"] != Glo.FK_MapData)
                            {
                                continue;
                            }

                            BPLink link = new BPLink();
                            link.Name    = dr["MyPK"];
                            link.Content = dr["Text"];
                            link.URL     = dr["URL"];

                            link.WinTarget = dr["Target"];

                            link.FontSize = double.Parse(dr["FontSize"]);
                            link.Cursor   = Cursors.Hand;
                            link.SetValue(Canvas.LeftProperty, double.Parse(dr["X"]));
                            link.SetValue(Canvas.TopProperty, double.Parse(dr["Y"]));

                            string color = dr["FontColor"];
                            if (string.IsNullOrEmpty(color))
                            {
                                color = "Black";
                            }

                            link.Foreground = new SolidColorBrush(Glo.ToColor(color));
                            this.canvasMain.Children.Add(link);
                        }
                        continue;

                    case "Sys_FrmImg":
                        foreach (DataRow dr in dt.Rows)
                        {
                            if (dr["FK_MapData"] != Glo.FK_MapData)
                            {
                                continue;
                            }

                            BPImg img = new BPImg();
                            img.Name   = dr["MyPK"];
                            img.Cursor = Cursors.Hand;
                            img.SetValue(Canvas.LeftProperty, double.Parse(dr["X"].ToString()));
                            img.SetValue(Canvas.TopProperty, double.Parse(dr["Y"].ToString()));

                            img.Width  = double.Parse(dr["W"].ToString());
                            img.Height = double.Parse(dr["H"].ToString());
                            this.canvasMain.Children.Add(img);
                        }
                        continue;

                    case "Sys_FrmImgAth":
                        foreach (DataRow dr in dt.Rows)
                        {
                            if (dr["FK_MapData"] != Glo.FK_MapData)
                            {
                                continue;
                            }

                            BPImgAth ath = new BPImgAth();
                            ath.Name   = dr["MyPK"];
                            ath.Cursor = Cursors.Hand;
                            ath.SetValue(Canvas.LeftProperty, double.Parse(dr["X"].ToString()));
                            ath.SetValue(Canvas.TopProperty, double.Parse(dr["Y"].ToString()));

                            ath.Height = double.Parse(dr["H"].ToString());
                            ath.Width  = double.Parse(dr["W"].ToString());
                            this.canvasMain.Children.Add(ath);
                        }
                        continue;

                    case "Sys_MapM2M":
                        foreach (DataRow dr in dt.Rows)
                        {
                            if (dr["FK_MapData"] != Glo.FK_MapData)
                            {
                                continue;
                            }

                            BPM2M m2m = new BPM2M(dr["NoOfObj"]);
                            m2m.SetValue(Canvas.LeftProperty, double.Parse(dr["X"]));
                            m2m.SetValue(Canvas.TopProperty, double.Parse(dr["Y"]));

                            m2m.Width  = double.Parse(dr["W"]);
                            m2m.Height = double.Parse(dr["H"]);
                            this.canvasMain.Children.Add(m2m);
                        }
                        continue;

                    case "Sys_FrmAttachment":
                        foreach (DataRow dr in dt.Rows)
                        {
                            if (dr["FK_MapData"] != Glo.FK_MapData)
                            {
                                continue;
                            }

                            string uploadTypeInt = dr["UploadType"].ToString();
                            if (uploadTypeInt == null)
                            {
                                uploadTypeInt = "0";
                            }

                            AttachmentUploadType uploadType = (AttachmentUploadType)int.Parse(uploadTypeInt);
                            if (uploadType == AttachmentUploadType.Single)
                            {
                                BPAttachment ath = new BPAttachment(dr["NoOfObj"],
                                                                    dr["Name"], dr["Exts"],
                                                                    double.Parse(dr["W"]), dr["SaveTo"].ToString());

                                ath.SetValue(Canvas.LeftProperty, double.Parse(dr["X"]));
                                ath.SetValue(Canvas.TopProperty, double.Parse(dr["Y"]));

                                ath.Label  = dr["Name"] as string;
                                ath.Exts   = dr["Exts"] as string;
                                ath.SaveTo = dr["SaveTo"] as string;

                                ath.X = double.Parse(dr["X"]);
                                ath.Y = double.Parse(dr["Y"]);

                                if (dr["IsUpload"] == "1")
                                {
                                    ath.IsUpload = true;
                                }
                                else
                                {
                                    ath.IsUpload = false;
                                }

                                if (dr["IsDelete"] == "1")
                                {
                                    ath.IsDelete = true;
                                }
                                else
                                {
                                    ath.IsDelete = false;
                                }

                                if (dr["IsDownload"] == "1")
                                {
                                    ath.IsDownload = true;
                                }
                                else
                                {
                                    ath.IsDownload = false;
                                }

                                this.canvasMain.Children.Add(ath);
                                continue;
                            }

                            if (uploadType == AttachmentUploadType.Multi)
                            {
                                BPAttachmentM athM = new BPAttachmentM();
                                athM.SetValue(Canvas.LeftProperty, double.Parse(dr["X"]));
                                athM.SetValue(Canvas.TopProperty, double.Parse(dr["Y"]));
                                athM.Name   = dr["NoOfObj"];
                                athM.Width  = double.Parse(dr["W"]);
                                athM.Height = double.Parse(dr["H"]);
                                athM.X      = double.Parse(dr["X"]);
                                athM.Y      = double.Parse(dr["Y"]);
                                athM.SaveTo = dr["SaveTo"];
                                athM.Text   = dr["Name"];
                                athM.Label  = dr["Name"];
                                this.canvasMain.Children.Add(athM);
                                continue;
                            }
                        }
                        continue;

                    default:
                        break;
                    }
                }
                loadingWindow.DialogResult = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show("err:" + table, ex.Message + " " + ex.StackTrace,
                                MessageBoxButton.OK);
            }
            this.SetGridLines();
        }