예제 #1
0
        /// <summary>
        /// 单击了dataGridView的某一行
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dataGridViewMenuMain_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (this.dataGridViewMenuMain.SelectedRows.Count <= 0)
            {
                return;
            }
            this.curRowIndex = e.RowIndex;

            string strSysId = this.dataGridViewMenuMain.SelectedRows[0].Cells["编号"].Value.ToString().Trim();

            if (strSysId == "")
            {
                return;
            }
            int intSyId = Convert.ToInt32(strSysId);

            string strSql = "select * from T_MenuCfgMain where Sysid={0}";

            strSql = string.Format(strSql, intSyId);

            InitFuncs initFuncs = new InitFuncs();

            initFuncs.ShowDatas(this.panelMenuMain, strSql);
            this.isAdd = false;//修改
        }
        private void FormCustomerMaInvoiceAdd_Load(object sender, EventArgs e)
        {
            InitFuncs inf = new InitFuncs();

            //inf.InitComboBox(this.t_IType, "[发票]发票种类");
            inf.InitComboBox(this.t_IType, "T_Invoice", "ITName");     //发票类型
            inf.InitComboBox(this.t_kpcorp, "T_StoreHouse", "SHName"); //所属公司


            //开票内容,从物料表中取,要对应到具体的物料(以A打头的物料)
            this.s_matid.Items.Clear();
            string    matid_ = "", matname_ = "";
            string    sql_ = "select matid,matname from T_matinf where Matid like 'A%'";
            DataTable dt   = (new SqlDBConnect()).Get_Dt(sql_);

            for (int m = 0; m < dt.Rows.Count; m++)
            {
                matid_   = dt.Rows[m]["matid"].ToString().Trim();
                matname_ = dt.Rows[m]["matname"].ToString().Trim();
                this.s_matid.Items.Add("[" + matid_ + "]" + matname_);
            }
            //

            s_CmSysId.Text = Cmsysid;
            if (this.type == "edit")
            {
                string strSql = "select * from T_CustomerMaInvoice where CmSysId='{0}'and sysid='{1}'";
                strSql = string.Format(strSql, this.Cmsysid, this.sysid);
                (new InitFuncs()).ShowDatas(this.panelkp, strSql);
                this.t_kpcorp.Text = (new DBUtil()).Get_Single_val("T_StoreHouse", "Shname", "shid", this.s_kpcorp.Text.Trim());
                this.t_IType.Text  = (new DBUtil()).Get_Single_val("T_Invoice", "ITName", "Itcode", this.s_IType.Text.Trim());
            }
        }
예제 #3
0
        private void FinancialForm_Load(object sender, EventArgs e)
        {
            InitFuncs initFuncs = new InitFuncs();

            initFuncs.InitComboBox(this.comboBoxPayMethod, "T_PayMethod", "PMName");

            this.txtCustId.KeyDown   += new KeyEventHandler(InfoFind.CustId_KeyDown);
            this.txtCustName.KeyDown += new KeyEventHandler(InfoFind.CustName_KeyDown);

            if (this.financialType == "收入")
            {
                this.Text                = "应收账务核销";
                this.labelInfo.Text      = "应收账务";
                this.btnAutoVeri.Visible = false;
            }
            if (this.financialType == "支出")
            {
                this.Text                = "应付账务核销";
                this.labelInfo.Text      = "应付账务";
                this.btnAutoVeri.Visible = true;
            }
            this.curUserName  = (this.MdiParent as MainForm).userName;
            this.curWorkMonth = (this.MdiParent as MainForm).curWorkMonth;//获得主窗体的当前工作月

            this.txtCustId.Focus();
        }
예제 #4
0
        /// <summary>
        /// 单击GridView的一行
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dataGridViewRoles_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            this.curSelectRowIndex = e.RowIndex;
            this.s_RoleId.ReadOnly = true;
            string roleId = this.dataGridViewRoles.SelectedRows[0].Cells["角色编号"].Value.ToString().Trim();

            if (roleId == "")
            {
                return;
            }

            string strSql = "select * from T_Roles where RoleId='{0}'";

            strSql = string.Format(strSql, roleId);

            InitFuncs initFuncs = new InitFuncs();

            initFuncs.ShowDatas(this.panelRoles, strSql);

            //处理DataGridView
            //先置空
            SetTreeViewNull(this.treeViewMenus.Nodes);

            List <string> listFunction = RoleRightsDAO.GetFunctionById(roleId);

            SetUserPermission(this.treeViewMenus, listFunction);
        }
예제 #5
0
        private void T_CustID_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                TextBox textBox = sender as TextBox;
                //Dictionary<string, string> findFields = new Dictionary<string, string>();
                //findFields.Add("CustID", "s");
                //findFields.Add("CustName", "s");
                //Dictionary<string,string> displayFields = new Dictionary<string,string>();
                //displayFields.Add("CustID", "客户编码");
                //displayFields.Add("CustName", "客户名称");
                //displayFields.Add("communicateAddr", "通信地址");
                //displayFields.Add("AtBank", "开户银行");
                //InitFuncs.FindInfoToControl(textBox, "T_CustomerInf", "CustID", findFields, displayFields);

                string textBoxName = textBox.Text.Trim();
                if (textBoxName == "")
                {
                    return;
                }
                string strSql = "select CustID as 客户编码,CustName as 客户名称,"
                                + "PinYinCode as 助记符,communicateAddr as 通信地址, "
                                + "Degree as 客户等级 " +
                                "from T_CustomerInf where CustID like '%{0}%' or CustName like '%{1}%' or PinYinCode like '%{2}%'";
                strSql = string.Format(strSql, textBoxName, textBoxName, textBoxName);
                InitFuncs.FindInfoToControl(textBox, strSql, "客户名称");
            }
        }
        private void ReceiptModalConfigForm_Load(object sender, EventArgs e)
        {
            InitFuncs initFuncs = new InitFuncs();

            initFuncs.InitComboBox(this.comboBoxReceName, "T_ReceiptModal", "ReceName");
            initFuncs.InitComboBox(this.comboBoxReceiptTypeID, "T_ReceiptModal", "ReceTypeID");
        }
예제 #7
0
        private void dataGridViewMenuChid_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (this.dataGridViewMenuChid.SelectedRows.Count <= 0)
            {
                return;
            }
            this.curRowIndex = e.RowIndex;

            string strSysId = this.dataGridViewMenuChid.SelectedRows[0].Cells["编号"].Value.ToString().Trim();

            if (strSysId == "")
            {
                return;
            }
            int intSyId = Convert.ToInt32(strSysId);

            this.txtSysid.Text = strSysId;

            string strSql = "select * from T_MenuCfgChild where SysId={0}";

            strSql = string.Format(strSql, intSyId);

            InitFuncs initFuncs = new InitFuncs();

            initFuncs.ShowDatas(this.panelMenuChild, strSql);////

            this.comboBoxMainMenu.Text = (new DBUtil()).Get_Single_val("T_MenuCfgMain", "MainMenu", "Sysid", this.n_MainMenuId.Text.Trim());
            this.comboBoxReceName.Text = (new DBUtil()).Get_Single_val("T_ReceiptModal", "ReceName", "ReceTypeID", this.s_SubMenu.Text.Trim());

            this.isAdd = false;//修改
        }
예제 #8
0
        private void InitDataGridViewChildTemp(string strReceiptId)
        {
            DataTable dt = MatSplitChildDAO.GetDatasByReceiptId(strReceiptId);

            InitFuncs initFuncs = new InitFuncs();

            initFuncs.InitDataGridView(this.dgvMatChild, dt);
        }
예제 #9
0
        /// <summary>
        /// 初始化绑定ComboBox
        /// </summary>
        private void InitComboBox()
        {
            //初始化ComboBox
            InitFuncs initFuncs = new InitFuncs();

            initFuncs.InitComboBox(this.comboBoxMainMenu, "T_MenuCfgMain", "MainMenu");
            initFuncs.InitComboBox(this.comboBoxReceName, "T_ReceiptModal", "ReceName");
        }
예제 #10
0
        private void btnClear_Click(object sender, EventArgs e)
        {
            this.isAdd = true;
            InitFuncs initFuncs = new InitFuncs();

            initFuncs.ClearData(this.panelMenuMain);
            this.s_MainMenu.Focus();
        }
예제 #11
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnClear_Click(object sender, EventArgs e)
        {
            InitFuncs initFuncs = new InitFuncs();

            initFuncs.ClearData(this.panelMenuChild);
            this.comboBoxMainMenu.Focus();
            this.isAdd = true;
        }
예제 #12
0
        private void BargainBindAddhctype_Load(object sender, EventArgs e)
        {
            (new InitFuncs()).Num_limited(this.panel1);
            //初始化无码数据
            InitFuncs inf = new InitFuncs();

            inf.InitComboBox(this.s_HcType, "[合同]幅面");
        }
예제 #13
0
        private void InitDataGridView()
        {
            DataTable dt = UserRoleDAO.GetDatasByUserId(this.userId);

            InitFuncs initFuncs = new InitFuncs();

            initFuncs.InitDataGridView(this.dataGridView, dt);
        }
예제 #14
0
        private void InitDataGridViewChild()
        {
            DataTable dt = MatSplitChildDAO.GetDatas();

            InitFuncs initFuncs = new InitFuncs();

            initFuncs.InitDataGridView(this.dgvMatChild, dt);
        }
예제 #15
0
        public void Resetdata(TextBox controls, Panel panelname)
        {
            controls.ReadOnly = false;
            controls.Focus();
            InitFuncs initFuncs = new InitFuncs();

            initFuncs.ClearData(panelname);
        }
예제 #16
0
        /// <summary>
        /// 定义一个通用显示在Tab的方法
        /// </summary>
        /// <param name="name">列名</param>
        /// <param name="tablename">表名</param>
        /// <param name="Id">主码</param>
        /// <param name="Panelname">Panelname</param>
        /// <param name="datagrid">dgv</param>
        public void Data_ToTab(string name, string tablename, string Id, Panel Panelname, DataGridView datagrid)
        {
            string ID     = datagrid.SelectedRows[0].Cells[name].Value.ToString().Trim();
            string strSql = "select * from {0} where " + Id + "='{1}'";

            strSql = string.Format(strSql, tablename, ID);
            InitFuncs initFuncs = new InitFuncs();

            initFuncs.ShowDatas(Panelname, strSql);
        }
예제 #17
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.s_RoleId.ReadOnly = false;
            this.s_RoleId.Focus();
            InitFuncs initFuncs = new InitFuncs();

            initFuncs.ClearData(this.panelRoles);

            SetTreeViewNull(this.treeViewMenus.Nodes);
        }
예제 #18
0
        private void init_muladd()
        {
            string sql_ = "select sysid as 系统编号,AddType as 地址种类,Addr as 客户地址,Memo as 备注 "
                          + " from T_CustomerAdd "
                          + " where custid='" + s_CustID.Text.Trim() + "'";
            DataTable dt        = (new SqlDBConnect()).Get_Dt(sql_);
            InitFuncs initFuncs = new InitFuncs();

            initFuncs.InitDataGridView(this.dataGridView_CustomerAdd, dt);
            this.dataGridView_CustomerAdd.Columns[0].Visible = false;
        }
예제 #19
0
        private void InitDataGridViewMain()
        {
            DataTable dt = MatSplitMainDAO.GetDatas();

            InitFuncs initFuncs = new InitFuncs();

            initFuncs.InitDataGridView(this.dgvMatMain, dt);

            this.dgvMatMain.ClearSelection();
            this.dgvMatMain.Rows[this.CurRowIndex].Selected = true;
        }
        private void InitDataGridView()
        {
            DataTable dt = ReceiptModalDAO.GetDatas();

            InitFuncs initFuncs = new InitFuncs();

            initFuncs.InitDataGridView(this.dataGridViewRecMod, dt);

            this.dataGridViewRecMod.ClearSelection();
            this.dataGridViewRecMod.Rows[this.curRowIndex].Selected = true;
        }
예제 #21
0
        private void init_fp()
        {
            string sql_ = "select sysid as 系统编号,IType as 发票种类,Ititle as 发票抬头,Idet as 发票内容,Memo as 备注 "
                          + " from T_CustomerInvoice "
                          + " where custid='" + s_CustID.Text.Trim() + "'";
            DataTable dt        = (new SqlDBConnect()).Get_Dt(sql_);
            InitFuncs initFuncs = new InitFuncs();

            initFuncs.InitDataGridView(this.dataGridView_Invoice, dt);
            this.dataGridView_Invoice.Columns[0].Visible = false;
        }
예제 #22
0
        private void init_lxr()
        {
            string sql_ = "select sysid as 系统编号,Cname as 联系人,ctype as 类别,sex as 性别,Email,Tel1 as 联系电话1,Tel2 as 联系电话2, tel as 手机 "
                          + " from T_CustMaContacts "
                          + " where CmSysId='" + Cmsysid + "'";
            DataTable dt        = (new SqlDBConnect()).Get_Dt(sql_);
            InitFuncs initFuncs = new InitFuncs();

            initFuncs.InitDataGridView(this.dataGridView_CustMaContacts, dt);
            this.dataGridView_CustMaContacts.Columns[0].Visible = false;
        }
예제 #23
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            #region //验证
            if (this.s_MainMenu.Text.Trim() == "")
            {
                MessageBox.Show("主菜单项不能为空!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (this.n_OrderIndex.Text.Trim() != "" && !Util.IsNumberic(this.n_OrderIndex))
            {
                MessageBox.Show("主顺序号输入有误,请输入数值!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (Util.LessOneNumber(this.n_OrderIndex, this.menuStripMain.Items.Count) == false)
            {
                MessageBox.Show("主顺序号只能输入小于等于" + this.menuStripMain.Items.Count + "的数字!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            #endregion

            SqlDBConnect db        = new SqlDBConnect();
            InitFuncs    initFuncs = new InitFuncs();
            DBUtil       dbUtil    = new DBUtil();

            string strSql  = "";
            string strSql_ = "";
            if (this.isAdd == true) //新增
            {
                strSql_ = "select * from T_MenuCfgMain where Ltrim(Rtrim(MainMenu))='{0}'";
                strSql_ = string.Format(strSql_, this.s_MainMenu.Text.Trim());
                //插入
                strSql = initFuncs.Build_Insert_Sql(this.panelMenuMain, "T_MenuCfgMain");
            }
            else //修改
            {
                //更新
                string strSqlWhere = "where Sysid='" + this.n_Sysid.Text.Trim() + "'";
                strSql = initFuncs.Build_Update_Sql(this.panelMenuMain, "T_MenuCfgMain", strSqlWhere);

                strSql_ = "select * from T_MenuCfgMain where Ltrim(Rtrim(Sysid)) != {0} and Ltrim(Rtrim(MainMenu))='{1}'";
                strSql_ = string.Format(strSql_, this.n_Sysid.Text.Trim(), this.s_MainMenu.Text.Trim());
            }
            if (dbUtil.yn_exist_data(strSql_))
            {
                MessageBox.Show("该主菜单项已存在!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            db.ExecuteNonQuery(strSql);
            MessageBox.Show("保存成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Warning);

            InitDataGridView();
        }
        /// <summary>
        /// 重置
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnClear_Click(object sender, EventArgs e)
        {
            InitFuncs initFuncs = new InitFuncs();

            initFuncs.ClearData(this.panelRecMain);
            initFuncs.ClearData(this.panelRecDet);

            this.listBoxMain.Items.Clear();
            this.listBoxMainTop.Items.Clear();
            this.listBoxMainBottom.Items.Clear();
            this.listBoxDetail.Items.Clear();
        }
예제 #25
0
        private void BargainForm_Load(object sender, EventArgs e)
        {
            //限制值类型文本框的输入
            (new InitFuncs()).Num_limited(this.panel1);

            s_SaleUser.KeyDown += new KeyEventHandler(InfoFind.UserName_KeyDown);

            // 合同:无码数据初始化
            InitFuncs inf = new InitFuncs();

            //inf.InitComboBox(this.s_ResponseHour, "[合同]响应速度");
            inf.InitComboBox(this.t_ContMaintetype, "[合同]签约类型");

            //区域:有码数据初始化
            inf.InitComboBox(this.t_UseType, "TB_machusedtype", "usedname");            //区域
            inf.InitComboBox(this.t_ContMaintetype, "tb_maintetype", "maintetypename"); //保修类别

            //合同:有码数据初始化
            s_Jftype.SelectedIndex          = 0;
            s_ContractType.SelectedIndex    = 0;
            t_ContMaintetype.SelectedIndex  = 0;
            s_FeeType.SelectedIndex         = 0;
            s_PreChargeMethod.SelectedIndex = 0;
            s_Payouttype.SelectedIndex      = 0;


            if (this.Type == "add")
            {
                this.s_Bargstatus.SelectedIndex = 1;
                s_BargId.ReadOnly   = false;
                this.panel3.Enabled = false; //不允许设置相关物料
                //this.panel4.Enabled = false;
            }
            else if (this.Type == "edit")
            {
                this.panel3.Enabled = true;
                //this.panel4.Enabled = true;

                string sel_sql = "select * from T_Bargains where sysid=" + this.BargSysId;
                inf.ShowDatas(this.panel1, sel_sql);
                //以下两行必须在ShowDatas后
                t_CustCode.Text            = (new DBUtil()).Get_Single_val("T_CustomerInf", "custname", "custid", s_CustCode.Text.Trim());
                this.custid_               = s_CustCode.Text.Trim();
                this.t_UseType.Text        = (new DBUtil()).Get_Single_val("TB_machusedtype", "usedname", "used_type", this.s_UseType.Text.Trim());
                this.t_ContMaintetype.Text = (new DBUtil()).Get_Single_val("tb_maintetype", "maintetypename", "maintetypecode", this.s_ContMaintetype.Text.Trim());

                this.t_CustCode.Text = (new DBUtil()).Get_Single_val("T_CustomerMac", "Mdepart", "sysid", this.n_MachineId.Text.Trim());

                //显示计费用信息
                show_fee_lst(this.BargSysId);
            }
        }
예제 #26
0
        private void ReceiptModalDefineForm_Load(object sender, EventArgs e)
        {
            InitFuncs initFuncs = new InitFuncs();

            if (this.type == "edit")
            {
                string strSqlSelect = "select * from T_ReceiptModal where ReceTypeID='{0}'";
                strSqlSelect = string.Format(strSqlSelect, this.receTypeId);

                initFuncs.ShowDatas(this.panelReceiptModal, strSqlSelect);
                this.s_ReceTypeID.ReadOnly = true;
            }
        }
예제 #27
0
        private void UserRelationForm_Load(object sender, EventArgs e)
        {
            string strUserName = (new DBUtil()).Get_Single_val("T_Users", "UserName", "UserId", this.userId);

            this.txtCurUserName.Text = strUserName;

            InitFuncs initFuncs = new InitFuncs();

            initFuncs.InitComboBox(this.comboBoxUserType, "T_UserType", "UtypeName");
            initFuncs.InitComboBox(this.comboBoxUserGrade, "T_UserGrade", "Gname");

            InitDataGridView();
        }
예제 #28
0
        /// <summary>
        /// 初始化绑定DataGridView
        /// </summary>
        private void InitDataGridView()
        {
            DataTable dt = MenuCfgChildDAO.GetDatas();

            InitFuncs initFuncs = new InitFuncs();

            initFuncs.InitDataGridView(this.dataGridViewMenuChid, dt);

            this.dataGridViewMenuChid.ClearSelection();
            this.dataGridViewMenuChid.Rows[this.curRowIndex].Selected = true;

            this.dataGridViewMenuChid.Columns[0].Visible = false;
        }
예제 #29
0
        /// <summary>
        /// 初始化显示数据表
        /// </summary>
        public void initDataGridView()
        {
            DataTable dt = UsersDAO.GetDatasOfUsers();

            InitFuncs initFuncs = new InitFuncs();

            initFuncs.InitDataGridView(this.dataGridViewUsers, dt);

            this.dataGridViewUsers.RowHeadersWidth = 45;

            this.dataGridViewUsers.ClearSelection();
            this.dataGridViewUsers.Rows[this.curRowIndex].Selected = true;
        }
예제 #30
0
        private void EditMatRela_Load(object sender, EventArgs e)
        {
            //限制值类型文本框的输入
            (new InitFuncs()).Num_limited(this.panelMatRela);

            initdataGridview();
            InitFuncs inifuncs = new InitFuncs();

            this.s_ParentMatID.Text   = this.pMatId;
            this.Pmatnametextbox.Text = this.pMatName;
            Pmatnametextbox.ReadOnly  = true;
            CmatnametextBox.ReadOnly  = true;
        }