Esempio n. 1
0
        /// <summary>
        /// 删除事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsDelete_Click(object sender, EventArgs e)
        {
            DataGridViewSelectedRowCollection rows = this.dgUsers.SelectedRows;

            if (rows.Count == 0)
            {
                TXMessageBoxExtensions.Info(SystemTips.MSG_ATLAST_SELECTROW_OP, SystemTips.MSG_TITLE);    //至少要选择一行记录才能够操作
                return;
            }
            else
            {       //询问是否删除
                if (TXMessageBoxExtensions.Question("确定要删除吗?") == DialogResult.Cancel)
                {
                    return;
                }
                else    //确定删除
                {
                    int id = Convert.ToInt16(rows[0].Cells["userid"].Value.ToString());
                    if (id == Globals.UserID)
                    {
                        TXMessageBoxExtensions.Info("不能删除已登陆的用户!");
                        return;
                    }
                    usersDB.Delete(id);    //删除
                    BindGridViewData();    //重新绑定数据
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 用来被查找子窗口调用、进行查询的具体方法
        /// </summary>
        public string DoFind(string nodeid, string codeno, string title, bool check1, bool check2)
        {
            string ret = nodeid;

            if (dsFildResult == null || dsFildResult.Count <= 0 || findKey == "" || findKey != title)
            {
                dsFildResult = treesData.DoFind(nodeid.Trim(','), MyCommon.ToSqlString(title), MyCommon.ToSqlString(codeno), check1, check2, Globals.ProjectNO);
                findKey      = title;
            }
            if (dsFildResult == null || dsFildResult.Count <= 0)
            {
                ret = "";
                TXMessageBoxExtensions.Info("没有找到相关资料!");
            }
            else
            {
                MDL.T_FileList obj = new ERM.MDL.T_FileList();
                if (dsFildResult.Count > 0)
                {
                    obj = dsFildResult[0];
                    dsFildResult.RemoveAt(0);
                    ExpendParentNode(obj);
                }
            }
            return(ret);
        }
Esempio n. 3
0
 private void btnConfirm_Click(object sender, EventArgs e)
 {
     if (txtMin.Text.Trim() == "" || txtMax.Text.Trim() == "")
     {
         TXMessageBoxExtensions.Info("输入不完整!");
         return;
     }
     if (!MyCommon.IsNumeric(txtMin.Text.Trim()) || !MyCommon.IsNumeric(txtMax.Text.Trim()))
     {
         TXMessageBoxExtensions.Info("请输入数值!");
         return;
     }
     if (Convert.ToDouble(txtMin.Text.Trim()) >= Convert.ToDouble(txtMax.Text.Trim()))
     {
         TXMessageBoxExtensions.Info("最大值必须大于最小值!");
         return;
     }
     IsInt = true;
     if (txtMin.Text.Contains(".") || txtMax.Text.Contains("."))
     {
         IsInt = false;
     }
     MinData           = Convert.ToDouble(txtMin.Text.Trim());
     MaxData           = Convert.ToDouble(txtMax.Text.Trim());
     this.DialogResult = DialogResult.OK;
 }
Esempio n. 4
0
        /// <summary>
        /// 设置参数
        /// </summary>
        private bool setValue()
        {
            if (this.txtSort.Text.Trim() == "")
            {
                TXMessageBoxExtensions.Info("顺序号不能为空!");
                this.txtSort.Focus();
                return(false);
            }

            if (this.txtX.Text.Trim() == "")
            {
                TXMessageBoxExtensions.Info("X坐标不能为空!");
                this.txtX.Focus();
                return(false);
            }

            if (this.txtY.Text.Trim() == "")
            {
                TXMessageBoxExtensions.Info("Y坐标不能为空!");
                this.txtY.Focus();
                return(false);
            }

            point.X          = this.txtX.Text;
            point.Y          = this.txtY.Text;
            point.OrderIndex = Convert.ToInt32(this.txtSort.Text);
            point.ProjectNo  = projectNo;

            return(true);
        }
Esempio n. 5
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            BLL.T_CellAndEFile_BLL cellAndFile_bll = new BLL.T_CellAndEFile_BLL();
            BLL.T_FileList_BLL     fileList_bll    = new BLL.T_FileList_BLL();
            int OrderIndex = 1;

            foreach (DataGridViewRow px_ros in dgv_PX.Rows)
            {
                try
                {
                    if (_Flg == 0)
                    {
                        //文件级
                        MDL.T_FileList fileMDL1 = fileList_bll.Find(px_ros.Cells["cl_ID"].Value.ToString(), Globals.ProjectNO);
                        fileMDL1.GdFileOrderIndex = OrderIndex;
                        fileList_bll.Update(fileMDL1);
                    }
                    else
                    {
                        //电子文件
                        MDL.T_CellAndEFile cellMDL = cellAndFile_bll.Find(px_ros.Cells["cl_ID"].Value.ToString(), Globals.ProjectNO);
                        cellMDL.GdOrderIndex = OrderIndex;
                        cellAndFile_bll.Update(cellMDL);
                    }
                    OrderIndex++;
                }
                catch (Exception ex)
                {
                    TXMessageBoxExtensions.Info("排序更新失败!" + ex.Message);
                }
            }
            TXMessageBoxExtensions.Info("修改成功!");
            this.DialogResult = DialogResult.OK;
        }
Esempio n. 6
0
 /// <summary>
 /// 获取文件总数
 /// </summary>
 /// <param name="sourceDirName">文件夹路径</param>
 /// <param name="check_flg">传入的状态值, 返回false 表示文件夹有错误 </param>
 /// <param name="fileCount">文件总数</param>
 public void GetFileCount(string sourceDirName, ref bool check_flg, ref int fileCount)
 {
     if (check_flg)
     {
         if (System.IO.Directory.Exists(sourceDirName))
         {
             string[] files = Directory.GetFiles(sourceDirName);
             if (files != null && files.Length > 0)
             {
                 fileCount += files.Length;
             }
             string[] dirs = Directory.GetDirectories(sourceDirName);
             foreach (string dir in dirs)
             {
                 GetFileCount(dir, ref check_flg, ref fileCount);
             }
         }
         else
         {
             check_flg = false;
             fileCount = 0;
             TXMessageBoxExtensions.Info("提示:文件夹路径错误:'" + sourceDirName + "' \n 【温馨提示:文件路径不存在或文件夹尾部可能包含特殊字符或全角字符 例如:空格,星号...】");
         }
     }
 }
Esempio n. 7
0
        /// <summary>
        /// 打开窗体的通用方法,如果没有处于打开状态,则实例化并打开,否则将光标聚焦到窗体上
        /// </summary>
        /// <param name="formName">这个参数是完整的类名,命名空间+窗体名称</param>
        public Form ShowOnce(string formName)
        {
            Form   form;
            string name = formName.Substring(formName.LastIndexOf(".") + 1); //先得到窗体的名称(无命名空间)

            form = Application.OpenForms[name];                              //打开窗体,如果窗体是打开状态,则返回值不为null
            if (form != null)                                                //如果窗体处于打开状态,则将光标聚集到窗体
            {
                form.Focus();
            }
            else//如果窗体不在打开状态,则通过简单工厂反射得到窗体,然后将窗体打开
            {
                Type type = Type.GetType(formName);
                if (type != null)
                {
                    form = (Form)System.Activator.CreateInstance(type);
                    form.Show();
                }
                else
                {
                    TXMessageBoxExtensions.Info("检测OpenOnceForm方法的参数是否输入了完整的窗体类名");
                }
            }
            return(form);
        }
Esempio n. 8
0
 private bool Check()
 {
     foreach (Control c in this.Controls)
     {
         if (c.GetType() == typeof(TextBox))
         {
             if (c.Text.Trim() == "")
             {
                 TXMessageBoxExtensions.Info("请将信息填写完整!");
                 c.Focus();
                 return(false);
             }
         }
     }
     if (numPages.Value <= numPfloat.Value)
     {
         TXMessageBoxExtensions.Info("页数浮动值必须小于页数稳定值!");
         numPages.Focus();
         return(false);
     }
     if (chIsDefault.Checked == false)
     {
         if ((pid.HasValue) && _IsDefault)
         {
             TXMessageBoxExtensions.Info("必须先设置一个默认!");
             return(false);
         }
     }
     return(true);
 }
Esempio n. 9
0
        /// <summary>
        /// 保存数据
        /// </summary>
        private void  SaveData()
        {
            if (!ValidatorData())
            {
                return;
            }

            if (this.OpType == "Add")//添加
            {
                BLL.T_Users_BLL     userBLL  = new T_Users_BLL();
                IList <MDL.T_Users> userList = userBLL.FindBylogin(txtLogin.Text);
                if (userList.Count <= 0)
                {
                    MDL.T_Users userMDL = GetData();
                    userBLL.Add(userMDL);
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    TXMessageBoxExtensions.Info("用户名已经存在!");
                    this.txtLogin.Focus();
                    return;
                }
            }
            else//编辑
            {
                MDL.T_Users userMDL = GetData();
                userMDL.userid = userid;
                BLL.T_Users_BLL userBLL = new T_Users_BLL();
                userBLL.Update(userMDL);
                this.DialogResult = DialogResult.OK;
            }
        }
Esempio n. 10
0
        /// <summary>
        /// 数据绑定
        /// </summary>
        private void DataBind()
        {
            this.gridGD.Rows.Clear();
            IList <T_GdListTemplate> list = null;

            try
            {
                list = templateBLL.GetAllByCategory(fileTemp);
            }
            catch (Exception)
            {
                TXMessageBoxExtensions.Info("没有查询到记录");
                return;
            }
            foreach (var item in list)
            {
                gridGD.Rows.Add();
                DataGridViewCellCollection dgvc = gridGD.Rows[gridGD.Rows.Count - 1].Cells;
                dgvc["GdName"].Value   = item.GdName.ToString();
                dgvc["fileType"].Value = item.ProjectCategory.ToString() == "Buildding"
                    ? "房屋工程" : item.ProjectCategory.ToString() == "Traffic" ? "地下管线工程" :
                                         item.ProjectCategory.ToString() == "RoadLamp" ? "道路工程" : "桥梁工程";
                dgvc["sorts"].Value = item.OrderIndex.ToString();
                dgvc["ID"].Value    = item.ID.ToString();
            }
        }
 private void btnSure_Click(object sender, EventArgs e)
 {
     if (txtTitle.Text.Trim() == "")
     {
         TXMessageBoxExtensions.Info("请输入标题!");
         txtTitle.Focus();
         return;
     }
     if (MyCommon.HasFilterChars(txtTitle.Text))
     {
         TXMessageBoxExtensions.Info("不能包含有" + MyCommon.Chars2String() + "等字符!");
         txtTitle.Focus();
         return;
     }
     if (TheNode == null)
     {
         if (IsTemplet)
         {
             if (!System.IO.File.Exists(txtLocalPath.Text.Trim()))
             {
                 TXMessageBoxExtensions.Info("文件不存在!");
                 btnExplorer.Focus();
                 return;
             }
             int pages = GetPages();
             if (pages == 0)
             {
                 TXMessageBoxExtensions.Info("文件格式不正确!");
                 return;
             }
         }
     }
     this.DialogResult = DialogResult.OK;
 }
Esempio n. 12
0
        /// <summary>
        /// 打印公共方法
        /// </summary>
        /// <param name="reportName"></param>
        /// <param name="dv">数据视图</param>
        /// <returns></returns>
        public void DoPrint(string reportName, DataView dv)
        {
            string reportPath = startPath + @"\Reports\" + reportName + ".mrt";

            ////报表文件是否存在
            if (!System.IO.File.Exists(reportPath))
            {
                TXMessageBoxExtensions.Info("报表文件丢失!");
                return;
            }

            this.stiReport = new StiReport();
            this.stiReport.Load(reportPath);
            this.stiReport.RegData(reportName, dv);
            this.stiReport.Compile();
            this.stiReport.Render();
            string pdfPath  = string.Empty;
            string rootPath = startPath + @"\Reports\printPdf_temp\";

            MyCommon.DeleteAndCreateEmptyDirectory(rootPath, true);

            pdfPath = rootPath + reportName + ".pdf";
            stiReport.ExportDocument(StiExportFormat.Pdf, pdfPath);
            frmReports = new frmReport(pdfPath);
            frmReports.ShowDialog();
        }
Esempio n. 13
0
        private void btnSearchConfirm_Click(object sender, EventArgs e)
        {
            string projectNO   = txt_ProjectNo.Text.Trim();
            string projectName = txt_ProjectName.Text.Trim();

            if (projectNO == "" && projectName == "")
            {
                txt_ProjectName.Focus();
                TXMessageBoxExtensions.Info("至少输入一个查询条件");
                return;
            }

            if (!MyCommon.IsMatchCode(projectNO))
            {
                projectNO = "";
            }

            if (!MyCommon.IsMatchCode(projectName))
            {
                projectName = "";
            }

            if (_parentForm != null)
            {
                this._parentForm.FindProject(
                    projectNO, projectName);
            }
            this.Focus();
        }
Esempio n. 14
0
        private void treeView1_DoubleClick(object sender, EventArgs e)
        {
            if (searchFrm != null)
            {
                try
                {
                    searchFrm.Close();
                }
                catch { }
            }
            ////当前节点
            TreeNodeEx theNode = treeView1.SelectedNode as TreeNodeEx;

            if (theNode == null)
            {
                return;
            }
            if (theNode.ImageIndex == 2 || theNode.ImageIndex == 7)
            {
                this.Cell2.closefile();

                frmCellEdit frm = new frmCellEdit(this, theNode, Mydel);
                frm.ShowDialog();

                showCell(theNode.Name);

                theNode.ImageIndex         = (treeFactory.CheckEFileByFileID(theNode.Name, 1) == true) ? 7 : 2;//判断是否有电子文件
                theNode.SelectedImageIndex = theNode.ImageIndex;

                MyFavorites obj = new MyFavorites();
                obj.Write(theNode.Name, theNode.Text);

                if (treeView1.Nodes.Count > 0)
                {
                    if (treeView1.Nodes[0].Text == "最近著录过的文件")
                    {
                        if (theNode.Parent != null && theNode.Parent.Text == "最近著录过的文件")
                        {
                            treeFactory.CreatemyFavoritesNode((TreeNodeEx)treeView1.Nodes[0]);
                            treeFactory.SelectNodeImage(treeView1, theNode.Name);
                        }
                        else
                        {
                            treeFactory.CreatemyFavoritesNode((TreeNodeEx)treeView1.Nodes[0]);
                        }
                    }
                    if (treeView1.Nodes.Count >= 1 && (!(treeView1.Nodes[1].IsExpanded)))
                    {
                        treeView1.Nodes[1].Expand();
                    }
                }
            }
            else if (theNode.ImageIndex == 4)
            {
                TXMessageBoxExtensions.Info("提示:已组卷的目录不允许编辑! \n 【温馨提示:如想编辑请在文件登记中撤销登记或在组卷目录移除此文件】");
            }
        }
Esempio n. 15
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (dateTimeEx1.TextEx.Length > 0)
     {
         SetSystemTime(DateTime.Parse(dateTimeEx1.TextEx));
         TXMessageBoxExtensions.Info("系统日期已更改,窗体讲关闭!");
         this.Close();
     }
 }
Esempio n. 16
0
        /// <summary>
        /// 色别验证
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void sb_Validating(object sender, CancelEventArgs e)
        {
            ComboBox com = (ComboBox)sender;

            if (com.Text.Length > 51)
            {
                TXMessageBoxExtensions.Info("色别验证输入字符过长!");
            }
        }
Esempio n. 17
0
        private void PrintAll(int type_flg)
        {
            if (treeView1.SelectedNode == null)
            {
                TXMessageBoxExtensions.Info("请选择你要打印的内容");
                return;
            }

            DataTable dt = new DataTable();

            dt.Columns.Add("title", typeof(string));
            dt.Columns.Add("filed", typeof(string));

            IList <MDL.T_CellAndEFile> cellList = null;

            if (type_flg == 0)
            {
                CreateCellTemp(ref dt, treeView1.SelectedNode);
                if (dt.Rows.Count == 0)
                {
                    TXMessageBoxExtensions.Info("无任何文件可以打印");
                    return;
                }
                delPrintPDF  del = new delPrintPDF(Printcells);
                frmPrintCell frm = new frmPrintCell(dt.DefaultView, del, true);
                frm.ShowDialog();
            }
            else
            {
                cellList =
                    treesData.GetNodeChildren(treeView1.SelectedNode.Name, Globals.ProjectNO, Globals.ProjectPath, type_flg);
                if (cellList != null && cellList.Count > 0)
                {
                    foreach (MDL.T_CellAndEFile cellAndEFile_mdl in cellList)
                    {
                        if (!MyCommon.CheckFillSuffix(cellAndEFile_mdl.filepath, ".cll"))
                        {
                            continue;
                        }
                        dt.Rows.Add(new object[] { cellAndEFile_mdl.title, Globals.ProjectPath + "\\" + cellAndEFile_mdl.filepath });
                    }
                    if (dt.Rows.Count == 0)
                    {
                        TXMessageBoxExtensions.Info("无任何文件可以打印");
                        return;
                    }
                    delPrintPDF  del = new delPrintPDF(Printcells);
                    frmPrintCell frm = new frmPrintCell(dt.DefaultView, del, true);
                    frm.ShowDialog();
                }
                else
                {
                    TXMessageBoxExtensions.Info("无任何文件可以打印");
                }
            }
        }
Esempio n. 18
0
        ////在失去焦点时,把最后一位小数点去掉       不好用
        //protected override void OnLostFocus(EventArgs e)
        //{
        //    base.OnLostFocus(e);
        //    this.Text = this.Text.Trim('.');
        //}
        protected override void OnLeave(EventArgs e)
        {
            string tag = (this.Tag == null ? "" : this.Tag.ToString().Trim());

            if (tag != "" && this.Text != "")
            {
                string[] strArr = tag.ToLower().Split(',');
                if (strArr.Length >= 2)
                {
                    string TagText = strArr[1];
                    if (TagText.ToLower() == "int".ToLower())
                    {
                        if (!IsValidInt(this.Text))
                        {
                            TXMessageBoxExtensions.Info("提示:\"" + strArr[0] + "\" 输入错误!\n【温馨提示:只能输入1-" + _MaxValuelLength + "位正整数】");
                            this.Focus();
                            this.Text = "";
                            return;
                        }
                        else
                        {
                            this.BackColor = System.Drawing.Color.White;
                        }
                    }
                    else if (TagText.ToLower() == "number".ToLower())
                    {
                        if (!IsValidDecimal(this.Text))
                        {
                            TXMessageBoxExtensions.Info("提示:\"" + strArr[0] + "\" 输入错误!\n【温馨提示:只能输入1-" + _MaxValuelLength + "位正整数或浮点数】");
                            this.Focus();
                            this.Text = "";
                            return;
                        }
                        //else if (!IsValidDecimal(this.Text, strArr[2]))
                        //{
                        //    TXMessageBoxExtensions.Info("提示:\"" + strArr[0] + "\" 输入错误! \n    【温馨提示:只能输入正整数或" + strArr[2] + "位浮点数】");
                        //    this.Focus();
                        //
                        //    return;
                        //}
                        else
                        {
                            this.BackColor = System.Drawing.Color.White;
                        }
                    }
                }
            }
            else
            {
                if (this.BackColor == System.Drawing.Color.Red)
                {
                    this.BackColor = System.Drawing.Color.White;
                }
            }
            base.OnLeave(e);
        }
Esempio n. 19
0
        private void tsmiChangePass_Click(object sender, EventArgs e)
        {
            frmChangeUserPasswd frm = new frmChangeUserPasswd();
            DialogResult        ret = frm.ShowDialog();

            if (ret == DialogResult.OK)
            {
                TXMessageBoxExtensions.Info(SystemTips.MSG_EDIT_PW_SUCC, SystemTips.MSG_TITLE);
            }
        }
Esempio n. 20
0
        private void bgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            bool b_result = (bool)e.Result;

            if (b_result)
            {
                TXMessageBoxExtensions.Info("已经成功生成上报文件!");
            }
            this.Close();
        }
Esempio n. 21
0
 /// <summary>
 /// 验证数据必填项
 /// </summary>
 /// <returns></returns>
 private bool ValidateData()
 {
     if (this.txtDistrictName.Text.Trim() == "")
     {
         TXMessageBoxExtensions.Info("区域名不能为空!");
         this.txtDistrictName.Focus();
         return(false);
     }
     return(true);
 }
Esempio n. 22
0
 private void linkInvert_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     if (this.CheckInvert != null)
     {
         this.CheckInvert(sender, e);
     }
     else
     {
         TXMessageBoxExtensions.Error("非常遗憾,该功能还未实现!开发人员和凤姐一起私奔了!");
     }
 }
Esempio n. 23
0
 /// <summary>
 /// 组卷
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnProjectArchive_Click(object sender, EventArgs e)
 {
     try
     {
         tsmiArichive_Click(null, null);
     }
     catch (Exception ex)
     {
         TXMessageBoxExtensions.Info(ex.Message.ToString());
     }
 }
Esempio n. 24
0
 private void tsbAdd_Click(object sender, EventArgs e)
 {
     if (this.Add != null)
     {
         this.Add(sender, e);
     }
     else
     {
         TXMessageBoxExtensions.Error("Error Information", "Oh!,I'm really awfully sorry,\n\nThe functions cannot be used!");
     }
 }
Esempio n. 25
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (MyCommon.IsInt(UpDown1.Text))
     {
         this.DialogResult = DialogResult.OK;
     }
     else
     {
         TXMessageBoxExtensions.Info("请输一个0-5的整数!");
     }
 }
Esempio n. 26
0
 private void tsbHelp_Click(object sender, EventArgs e)
 {
     if (this.Help != null)
     {
         this.Help(sender, e);
     }
     else
     {
         TXMessageBoxExtensions.Error("非常遗憾,该功能还未实现!开发人员和凤姐一起私奔了!");
     }
 }
Esempio n. 27
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (Dgv1.Rows.Count == 0)
            {
                TXMessageBoxExtensions.Info("没有可编辑的数据!");
                return;
            }
            if (Dgv1.CurrentRow.Index < 0)
            {
                TXMessageBoxExtensions.Info("请选择一行数据进行编辑!");
                return;
            }
            string unitid   = Dgv1.Rows[Dgv1.CurrentRow.Index].Cells[0].Value.ToString(); //当前unitid
            string unitType = Dgv1.Rows[Dgv1.CurrentRow.Index].Cells[1].Value.ToString(); //当前单位类型
            //BUG修复20170420,如果不选择左侧的单位类型会导致编辑传过去的单位类型为空,改为如果为空则传当前选中行的单位类型
            frmUnit      frm = new frmUnit(txtUnittype.Text == "" ? unitType : txtUnittype.Text, txtProjectNo.Text, unitid);
            DialogResult ret = frm.ShowDialog();  //open

            if (ret == DialogResult.OK)
            {
                MDL.T_Units unitMDL  = (new ERM.BLL.T_Units_BLL()).Find(unitid);
                string      unittype = frm.cboUnittype.SelectedValue.ToString();
                unitMDL.unittype = unittype;
                if (string.Compare(unittype, "unit12", true) == 0 || string.Compare(unittype, "unit13", true) == 0)
                {
                    unitMDL.dwmc   = frm.label5.Text;
                    unitMDL.fzr    = MyCommon.ToSqlString(frm.txtOther.Text.Trim());
                    unitMDL.fzrzs  = string.Empty;
                    unitMDL.xmjl   = string.Empty;
                    unitMDL.zzdj   = string.Empty;
                    unitMDL.zzzh   = string.Empty;
                    unitMDL.addr   = string.Empty;
                    unitMDL.tel    = string.Empty;
                    unitMDL.fax    = string.Empty;
                    unitMDL.remark = string.Empty;
                }
                else
                {
                    unitMDL.dwmc   = MyCommon.ToSqlString(frm.txtDwmc.Text.Trim());
                    unitMDL.fzr    = MyCommon.ToSqlString(frm.txtFzr.Text.Trim());
                    unitMDL.fzrzs  = MyCommon.ToSqlString(frm.txtFzrzs.Text.Trim());
                    unitMDL.xmjl   = MyCommon.ToSqlString(frm.txtXmjl.Text.Trim());
                    unitMDL.zzdj   = MyCommon.ToSqlString(frm.txtZzdj.Text.Trim());
                    unitMDL.zzzh   = MyCommon.ToSqlString(frm.txtZzzh.Text.Trim());
                    unitMDL.addr   = MyCommon.ToSqlString(frm.txtAddr.Text.Trim());
                    unitMDL.tel    = MyCommon.ToSqlString(frm.txtTel.Text.Trim());
                    unitMDL.fax    = MyCommon.ToSqlString(frm.txtFax.Text.Trim());
                    unitMDL.remark = MyCommon.ToSqlString(frm.txtRemark.Text.Trim());
                }
                (new ERM.BLL.T_Units_BLL()).Update(unitMDL);
                this.LoadDataFromView(txtUnittype.Text);
            }
        }
Esempio n. 28
0
 private void Paging(object sender)
 {
     if (OnPaging != null)
     {
         PagerEventArgs e = new PagerEventArgs(this.PageIndex, this.PageSize);
         this.OnPaging(sender, e);
     }
     else
     {
         TXMessageBoxExtensions.Error("这个技术人员很懒啊,还没实现分页查询功能的!");
     }
 }
Esempio n. 29
0
        private void AddNewNode(string Action, string txtLocalPath, string StrTitle)
        {
            TreeNodeEx theNode = (TreeNodeEx)treeView1.SelectedNode;

            int    orderindex = (new BLL.T_CellAndEFile_BLL()).GetMaxOrderIndex(theNode.Name, Globals.ProjectNO);//treesData.GetNextIndex(theNode.Name, Globals.ProjectNO);
            string ParentID   = theNode.Name;
            string Filepath   = txtLocalPath;
            string Title      = StrTitle;
            string ProjectNO  = Globals.ProjectNO;

            fileModel            = new ERM.MDL.T_FileList();
            fileModel.gdwj       = Title;
            fileModel.wjtm       = Title;
            fileModel.FileID     = Guid.NewGuid().ToString();
            fileModel.ParentID   = ParentID;
            fileModel.ProjectNO  = ProjectNO;
            fileModel.OrderIndex = (new BLL.T_FileList_BLL()).GetMaxOrderIndex(ParentID, Globals.ProjectNO) + 1;
            fileModel.isvisible  = 1;
            fileModel.fileStatus = "0";
            fileModel.FL         = 0;

            (new BLL.T_FileList_BLL()).Add(fileModel);

            MDL.T_CellAndEFile cellMode = new ERM.MDL.T_CellAndEFile();
            cellMode.CellID = Guid.NewGuid().ToString();

            if (!System.IO.File.Exists(Filepath))
            {
                TXMessageBoxExtensions.Info("文件不存在!");
                return;
            }
            System.IO.File.Copy(Filepath, Globals.ProjectPath + "ODOC\\" + cellMode.CellID + ".cll", true);

            cellMode.filepath = "ODOC\\" + cellMode.CellID + ".cll";

            cellMode.orderindex = orderindex + 1;
            cellMode.FileID     = fileModel.FileID;
            cellMode.isvisible  = 1;
            cellMode.EFileType  = true;//电子文件类型,0=false 系统的,-1=true 用户上传的
            cellMode.ProjectNO  = ProjectNO;
            cellMode.title      = Title;
            cellBLL.Add(cellMode);

            TreeNodeEx newNode = new TreeNodeEx();

            newNode.Name               = cellMode.FileID;
            newNode.ImageIndex         = 2;
            newNode.SelectedImageIndex = 2;
            newNode.Text               = cellMode.title;

            theNode.Nodes.Add(newNode);
            theNode.Expand();
        }
Esempio n. 30
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            TreeNode CureNode = treeView1.SelectedNode;

            if (CureNode == null)
            {
                TXMessageBoxExtensions.Info("提示:选择需要导入的节点!");
                return;
            }

            if (CureNode.ImageIndex != 1)
            {
                if (CureNode.ImageIndex == 0 && CureNode.Text.Trim() == "最近著录过的文件")
                {
                    TXMessageBoxExtensions.Info("提示:只能选择文件夹目录或文件目录导入!");
                    return;
                }
                else if (CureNode.ImageIndex == 4)
                {
                    TXMessageBoxExtensions.Info("提示:已组卷的目录不允许编辑! \n 【温馨提示:如想编辑请在文件登记中撤销登记或在组卷目录移除此文件】");
                    return;
                }
                else if (CureNode.ImageIndex == 3)
                {
                    TXMessageBoxExtensions.Info("提示:只能选择文件夹目录或文件目录导入!");
                    return;
                }
            }

            int  DelCount  = 0;
            bool check_flg = false;

            CheckFileNodeIsArch(CureNode, ref check_flg, ref DelCount);
            if (check_flg)
            {
                TXMessageBoxExtensions.Info("提示:已组卷 或 保存的目录不允许编辑! \n 【温馨提示:如想编辑请在文件登记中撤销登记或在组卷目录移除此文件】");
                return;
            }

            if (TXMessageBoxExtensions.Question("提示:确定给节点:[ " + CureNode.Text + " ] 导入信息吗?") != DialogResult.OK)
            {
                return;
            }

            frmImpData   Frm = new frmImpData(CureNode, TreeNodeState_flg, 1);
            DialogResult drt = Frm.ShowDialog();

            if (drt == DialogResult.OK)
            {
                treeFactory.ResetDS();
                TXMessageBoxExtensions.Info("导入数据成功!");
            }
        }