/// <summary>
 /// 确定按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonX1_Click(object sender, EventArgs e)
 {
     try
     {
         string   wuliudanhao = this.textBoxXdanhao.Text.Trim(); //单号
         string   wuliumingc  = this.textBoxXname.Text.Trim();   //名称
         string   wuliuTel    = this.textBoxXTel.Text.Trim();    //电话
         DateTime daohrq      = this.dateTimeInput1.Value;       //预计到货日期
         Buy      b           = new Buy();
         b.Buy_LogCode   = XYEEncoding.strCodeHex(wuliudanhao);
         b.Buy_Logistics = XYEEncoding.strCodeHex(wuliumingc);
         b.Buy_LogPhone  = XYEEncoding.strCodeHex(wuliuTel);
         b.Buy_GetDate   = daohrq;
         b.Buy_Code      = XYEEncoding.strCodeHex(danhao);
         bool result = bm.LogisticalUpdate(b);
         if (result)
         {
             MessageBox.Show("物流信息添加成功!");
             this.Close();
             return;
         }
         else
         {
             MessageBox.Show("物流信息添加失败!");
             return;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("错误代码:3214-新增物流信息时保存异常,异常信息:" + ex.Message);
     }
 }
        /// <summary>
        /// 添加信息
        /// </summary>
        /// <param name="ba">参数实体类</param>
        /// <returns></returns>
        public int InsBankAccount(BankAccount ba)
        {
            string sql = @"insert into T_BankAccount(
                            Ba_Code,
                            Ba_OpenBank,
                            Ba_Account,
                            Ba_CardHolder,
                            Ba_Remark,
                            Ba_AvailablePrice,
                            Ba_Enable,
                            Ba_Clear)
                            values (
                            @Ba_Code,
                            @Ba_OpenBank,
                            @Ba_Account,
                            @Ba_CardHolder,
                            @Ba_Remark,
                            @Ba_AvailablePrice,
                            @Ba_Enable,
                            @Ba_Clear)";

            SqlParameter[] sps =
            {
                new SqlParameter("@Ba_Code",           XYEEncoding.strCodeHex(ba.Ba_Code)),
                new SqlParameter("@Ba_OpenBank",       XYEEncoding.strCodeHex(ba.Ba_OpenBank)),
                new SqlParameter("@Ba_Account",        XYEEncoding.strCodeHex(ba.Ba_Account)),
                new SqlParameter("@Ba_CardHolder",     XYEEncoding.strCodeHex(ba.Ba_CardHolder)),
                new SqlParameter("@Ba_Remark",         XYEEncoding.strCodeHex(ba.Ba_Remark)),
                new SqlParameter("@Ba_AvailablePrice", XYEEncoding.strCodeHex(ba.Ba_AvailablePrice)),
                new SqlParameter("@Ba_Enable",         ba.Ba_Enable),
                new SqlParameter("@Ba_Clear",          ba.Ba_Clear)
            };
            return(DbHelperSQL.ExecuteSql(sql, sps));
        }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(Role model)
 {
     model.Role_Code    = XYEEncoding.strCodeHex(model.Role_Code);
     model.Role_Modules = XYEEncoding.strCodeHex(model.Role_Modules);
     model.Role_Name    = XYEEncoding.strCodeHex(model.Role_Name);
     return(dal.Add(model));
 }
        /// <summary>
        /// 删除按钮 转码code用于删除的where条件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void  除DToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (superGridControl1.PrimaryGrid.GetSelectedRows() == null)
            {
                ClientTypeManager         ctm = new ClientTypeManager();
                SelectedElementCollection col = superGridControl1.PrimaryGrid.GetSelectedRows();
                DialogResult dr = MessageBox.Show("确定要删除该数据吗?操作不可恢复", "请注意",
                                                  MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (dr == DialogResult.No)
                {
                    return;
                }

                GridRow row = col[0] as GridRow;

                string code = XYEEncoding.
                              strCodeHex(row.Cells["TypeCode"].Value.ToString());

                bool result = ctm.Delete(code);
                if (result)
                {
                    loadData();
                    MessageBox.Show("客户类别删除成功");
                }
                else
                {
                    MessageBox.Show("删除失败,请检查是否选中列");
                }
            }
            else
            {
                MessageBox.Show("请先选中要修改的数据所在行");
            }
        }
        /// <summary>
        /// 新增物流跟进
        /// </summary>
        /// <param name="buyprocess"></param>
        /// <returns></returns>
        public int InsBuyFollow(BuyProcess buyprocess)
        {
            string sql = @"INSERT INTO T_BuyProcess  
           (BP_Code
           ,BP_Datetime
           ,BP_Opt
           ,BP_Ope
           ,BP_Remark) 
          Values
          (@BP_Code
           ,@BP_Datetime
           ,@BP_Opt
           ,@BP_Ope
           ,@BP_Remark)";

            SqlParameter[] sps =
            {
                new SqlParameter("@BP_Code",     XYEEncoding.strCodeHex(buyprocess.BP_Code)),
                new SqlParameter("@BP_Datetime", buyprocess.BP_Datetime),
                new SqlParameter("@BP_Opt",      XYEEncoding.strCodeHex(buyprocess.BP_Opt)),
                new SqlParameter("@BP_Ope",      XYEEncoding.strCodeHex(buyprocess.BP_Ope)),
                new SqlParameter("@BP_Remark",   XYEEncoding.strCodeHex(buyprocess.BP_Remark))
            };
            return(DbHelperSQL.ExecuteSql(sql, sps));
        }
Beispiel #6
0
        private void BuyPaymentForm_Load(object sender, EventArgs e)
        {
            try
            {
                //绑定采购明细
                DataTable dt = ch.DataTableReCoding(bpm.SelEmp(" buy.Buy_Code='" + XYEEncoding.strCodeHex(_buycode) + "'").Tables[0]);
                superGridControl1.PrimaryGrid.DataSource = dt;
                superGridControl1.PrimaryGrid.AllowEdit  = false;

                LoginInfomation l = LoginInfomation.getInstance();
                l.UserName          = "******";
                ltxt_operation.Text = l.UserName;

                txt_yifu.Visible           = false;
                ltxt_weipay.ReadOnly       = true;
                dataGridViewFujia.ReadOnly = true;
                dataGridViewFujia.AllowUserToResizeColumns = false; //是否可以调整列的大小
                dataGridViewFujia.AllowUserToResizeRows    = false; //是否可以调整行的大小

                txt_caigoucode.Text   = _buycode;
                ltxt_suname.Text      = _suname;
                ltxt_AccountName.Text = _acountname;
                txt_shif.Text         = _fukuan;
                ltxt_saleman.Text     = _saleman;
            }
            catch (Exception ex)
            {
                MessageBox.Show("错误代码:3205-创建采购付款单异常,异常信息:" + ex.Message);
            }

            textBoxOddNumbers.Text = BuildCode.ModuleCode("AP");
        }
Beispiel #7
0
 private void buttonSave_Click(object sender, EventArgs e)
 {
     if (InsTextIsNull() == false)
     {
         return;
     }
     try
     {
         int result = InsBuypaymentFun();
         if (result > 0)
         {
             bool r = bm.PaymentUpdateByCode(XYEEncoding.strCodeHex(_buycode), 2);
             if (r)
             {
                 MessageBox.Show("保存成功");
                 Close();
                 Dispose();
                 return;
             }
         }
         else
         {
             MessageBox.Show("保存失败");
             return;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("错误代码:3206-保存采购付款单异常,异常信息:" + ex.Message);
     }
 }
        // 分页获取数据列表
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  BasicMethod

        #region ExtensionMethod

        /// <summary>
        /// 根据code更新数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool UpdateByCode(City model)
        {
            model.City_Name     = XYEEncoding.strCodeHex(model.City_Name);
            model.City_Code     = XYEEncoding.strCodeHex(model.City_Code);
            model.City_ParentId = XYEEncoding.strCodeHex(model.City_ParentId);
            return(dal.UpdateByCode(model));
        }
Beispiel #9
0
        /// <summary>
        /// 批量更新数据
        /// </summary>
        /// <param name="ds"></param>
        /// <returns></returns>
        public bool UpdateBatch(DataTable ds)
        {
            StringBuilder strSql = new StringBuilder();

            foreach (DataRow dr in ds.Rows)
            {
                if (dr.RowState == DataRowState.Modified)
                {
                    strSql.Append("update T_Permission set Per_ReadState = " + dr["Per_ReadState"] +
                                  ",Per_WriteState = " + dr["Per_WriteState"] +
                                  ",Per_AuditState = " + dr["Per_AuditState"] +
                                  " where Per_Code = '" + XYEEncoding.strCodeHex(dr["Per_Code"].ToString()) + "';");
                }
            }

            if (strSql.Length == 0)
            {
                return(false);
            }

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(MaterialType model)
        {
            model.MT_Code     = XYEEncoding.strCodeHex(model.MT_Code);
            model.MT_Name     = XYEEncoding.strCodeHex(model.MT_Name);
            model.MT_ParentID = XYEEncoding.strCodeHex(model.MT_ParentID);

            return(dal.Add(model));
        }
Beispiel #11
0
        /// <summary>
        /// 根据user_role做内链接
        /// </summary>
        /// <param name="name"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public DataTable GetUserAndRoleModel(string name, string password)
        {
            CodingHelper ch = new CodingHelper();

            //查询后解密返回
            return(ch.DataTableReCoding(dal.GetUserAndRoleModel(XYEEncoding.strCodeHex(name),
                                                                XYEEncoding.strCodeHex(password))));
        }
        /// <summary>
        /// 根据code更新一条数据
        /// </summary>
        public bool UpdateByCode(MaterialType model)
        {
            model.MT_Name     = XYEEncoding.strCodeHex(model.MT_Name);
            model.MT_Code     = XYEEncoding.strCodeHex(model.MT_Code);
            model.MT_ParentID = XYEEncoding.strCodeHex(model.MT_ParentID);

            return(dal.UpdateByCode(model));
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  BasicMethod

        #region  ExtensionMethod

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool UpdateByCode(Storage model)
        {
            model.St_Address = XYEEncoding.strCodeHex(model.St_Address);
            model.St_Code    = XYEEncoding.strCodeHex(model.St_Code);
            model.St_EmpName = XYEEncoding.strCodeHex(model.St_EmpName);
            model.St_Name    = XYEEncoding.strCodeHex(model.St_Name);
            model.St_Phone   = XYEEncoding.strCodeHex(model.St_Phone);
            model.St_Remark  = XYEEncoding.strCodeHex(model.St_Remark);
            return(dal.UpdateByCode(model));
        }
 /// <summary>
 /// 批量插入权限信息到数据库中
 /// </summary>
 /// <param name="pList">要新增的实体列表</param>
 /// <returns></returns>
 public int AddBatch(List <Permission> pList)
 {
     foreach (var p in pList)
     {
         p.Per_Code       = XYEEncoding.strCodeHex(p.Per_Code);
         p.Per_ModuleName = XYEEncoding.strCodeHex(p.Per_ModuleName);
         p.Per_RoleCode   = XYEEncoding.strCodeHex(p.Per_RoleCode);
         p.Per_Type       = XYEEncoding.strCodeHex(p.Per_Type);
     }
     return(dal.AddBatch(pList));
 }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Storage model)
        {
            model.St_Address = XYEEncoding.strCodeHex(model.St_Address);
            model.St_Code    = XYEEncoding.strCodeHex(model.St_Code);
            model.St_EmpName = XYEEncoding.strCodeHex(model.St_EmpName);
            model.St_Name    = XYEEncoding.strCodeHex(model.St_Name);
            model.St_Phone   = XYEEncoding.strCodeHex(model.St_Phone);
            model.St_Remark  = XYEEncoding.strCodeHex(model.St_Remark);

            return(dal.Add(model));
        }
        /// <summary>
        /// 查询历史折扣
        /// </summary>
        /// <param name="clientName"></param>
        /// <param name="maName"></param>
        /// <returns></returns>
        public DataTable SelDiscountByAccount(string clientName, string maName)
        {
            string         sql     = string.Format(@"select DISTINCT '241E2E532E3F583F' as 价格类型,sd.Sell_DiscountAPrice as 价格,sd.Sell_Discount as 折扣率 from T_Sell s
inner join T_SellDetail sd on  sd.Sell_Code = s.Sell_Code
where s.Sell_ClientName = '{0}' and sd.Sell_MaName = '{1}'", XYEEncoding.strCodeHex(clientName), XYEEncoding.strCodeHex(maName));
            SqlDataAdapter adapter = new SqlDataAdapter(sql, DbHelperSQL.connectionString);
            DataSet        ds      = new DataSet();

            adapter.Fill(ds, "T_SellDetail");
            return(ch.DataTableReCoding(ds.Tables[0]));
        }
        /// <summary>
        /// 多条件查询(地区类型-地区列表-关键词)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            try
            {
                List <Supplier> list       = new List <Supplier>();
                string          SQLWhere   = "";
                string          treeName   = treeView1.SelectedNode.Text;
                string          treeTag    = treeView1.SelectedNode.Tag.ToString();
                string          searchType = toolStripComboBox2.Text.Trim();
                string          searchKey  = XYEEncoding.strCodeHex(toolStripSelTxt.Text.Trim());

                if (treeView1.SelectedNode == null)  //如果TreeView选中项为空
                {
                    return;
                }
                if (string.IsNullOrWhiteSpace(toolStripSelTxt.Text.Trim()))  //如果搜索关键字为空
                {
                    return;
                }
                SQLWhere += string.Format("Su_Area like '%{0}%'", XYEEncoding.strCodeHex(treeName));

                //模糊查询城市名
                switch (searchType) //搜索框内容加密后
                {
                case "单位名称":
                    SQLWhere += string.Format(" and Su_Name like '%{0}%'", searchKey);
                    break;

                case "联系人":
                    SQLWhere += string.Format(" and Su_Empname like '%{0}%'", searchKey);
                    break;

                case "联系手机":
                    SQLWhere += string.Format(" and Su_EmpPhone like '%{0}%'", searchKey);
                    break;

                case "常用电话":
                    SQLWhere += string.Format(" and Su_Phone like '%{0}%'", searchKey);
                    break;

                default:
                    MessageBox.Show("类型选择错误,请重新选择!");
                    break;
                }
                list = sm.SelSupplierByWhere(SQLWhere);  //拼接where
                superGridControl1.PrimaryGrid.DataSource = list;
            }
            catch (Exception ex)
            {
                MessageBox.Show("加载数据失败,请检查服务器连接并尝试刷新.错误:" + ex.Message);
            }
        }
        public Sell SelSellGatheringBySellCode(string Sell_Code)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 Sell_ID,Sell_Code,Sell_Type,Sell_Date,Sell_TransportType,Sell_Review,Sell_ChangeDate,Sell_Operation,Sell_Auditman,Sell_Remark,");
            strSql.Append("Sell_IsPay,Sell_IsPutSto,Sell_PayMathod,Sell_GetDate,Sell_Logistics,Sell_LogCode,Sell_LogPhone,Sell_OddMoney,Sell_AccountCode,Sell_InMoney,Sell_LastMoney,Sell_Address,");
            strSql.Append("Sell_ClientName,Sell_CliPhone,Sell_LinkMan,Sell_Salesman,Sell_OddStatus,Sell_jiajiState,Sell_zuiwanshijian,Sell_fukuanfangshi from T_Sell");
            strSql.Append(" where Sell_Code=@Sell_Code");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Sell_Code", SqlDbType.NVarChar, 512)
            };
            parameters[0].Value = XYEEncoding.strCodeHex(Sell_Code);
            SqlDataReader read = DbHelperSQL.ExecuteReader(strSql.ToString(), parameters);

            while (read.Read())
            {
                Sell model = new Sell();
                model.Sell_ID            = Convert.ToInt32(read["Sell_ID"]);
                model.Sell_Code          = XYEEncoding.strHexDecode(read["Sell_Code"].ToString());
                model.Sell_Type          = XYEEncoding.strHexDecode(read["Sell_Type"].ToString());
                model.Sell_Date          = Convert.ToDateTime(read["Sell_Date"]);
                model.Sell_TransportType = XYEEncoding.strHexDecode(read["Sell_TransportType"].ToString());
                model.Sell_Review        = Convert.ToInt32(read["Sell_Review"]);
                model.Sell_ChangeDate    = Convert.ToDateTime(read["Sell_ChangeDate"]);
                model.Sell_Operation     = XYEEncoding.strHexDecode(read["Sell_Operation"].ToString());
                model.Sell_Auditman      = XYEEncoding.strHexDecode(read["Sell_Auditman"].ToString());
                model.Sell_Remark        = XYEEncoding.strHexDecode(read["Sell_Remark"].ToString());
                model.Sell_IsPay         = Convert.ToInt32(read["Sell_IsPay"]);
                model.Sell_IsPutSto      = Convert.ToInt32(read["Sell_IsPutSto"]);
                model.Sell_PayMathod     = Convert.ToInt32(read["Sell_PayMathod"]);
                model.Sell_GetDate       = Convert.ToDateTime(read["Sell_GetDate"]);
                model.Sell_Logistics     = XYEEncoding.strHexDecode(read["Sell_Logistics"].ToString());
                model.Sell_LogCode       = XYEEncoding.strHexDecode(read["Sell_LogCode"].ToString());
                model.Sell_LogPhone      = XYEEncoding.strHexDecode(read["Sell_LogPhone"].ToString());
                model.Sell_OddMoney      = read["Sell_OddMoney"].ToString();
                model.Sell_AccountCode   = XYEEncoding.strHexDecode(read["Sell_AccountCode"].ToString());
                model.Sell_InMoney       = read["Sell_InMoney"].ToString();
                model.Sell_LastMoney     = read["Sell_LastMoney"].ToString();
                model.Sell_Address       = XYEEncoding.strHexDecode(read["Sell_Address"].ToString());
                model.Sell_ClientName    = XYEEncoding.strHexDecode(read["Sell_ClientName"].ToString());
                model.Sell_CliPhone      = XYEEncoding.strHexDecode(read["Sell_CliPhone"].ToString());
                model.Sell_LinkMan       = XYEEncoding.strHexDecode(read["Sell_LinkMan"].ToString());
                model.Sell_Salesman      = XYEEncoding.strHexDecode(read["Sell_Salesman"].ToString());
                model.Sell_OddStatus     = Convert.ToInt32(read["Sell_OddStatus"]);
                model.Sell_jiajiState    = Convert.ToInt32(read["Sell_jiajiState"]);
                model.Sell_zuiwanshijian = Convert.ToDateTime(read["Sell_zuiwanshijian"]);
                model.Sell_fukuanfangshi = XYEEncoding.strHexDecode(read["Sell_fukuanfangshi"].ToString());
                return(model);
            }
            return(null);
        }
Beispiel #19
0
        /// <summary>
        /// 根据工号修改信息
        /// </summary>
        /// <param name="empolyee"></param>
        /// <returns></returns>
        public int UpdateEmpolyee(Empolyee empolyee)
        {
            string sql = @"update T_Empolyee set 
             Emp_Name=@Emp_Name
            ,Emp_Password=@Emp_Password
            ,Emp_UserRole=@Emp_UserRole
            ,Emp_Area=@Emp_Area
            ,Emp_zhiwen=@Emp_zhiwen
            ,Emp_CardCode=@Emp_CardCode
            ,Emp_Depid=@Emp_Depid
            ,Emp_Sex=@Emp_Sex
            ,Emp_Card=@Emp_Card
            ,Emp_State=@Emp_State
            ,Emp_Phone=@Emp_Phone
            ,Emp_Bank=@Emp_Bank
            ,Emp_OpenBank=@Emp_OpenBank
            ,Emp_Birthday=@Emp_Birthday
            ,Emp_Email=@Emp_Email
            ,Emp_Education=@Emp_Education
            ,Emp_School=@Emp_School
            ,Emp_Entry=@Emp_Entry
            ,Emp_Enable=@Emp_Enable
            ,Emp_Clear=@Emp_Clear
             where Emp_Code=@Emp_Code";

            SqlParameter[] sps =
            {
                new SqlParameter("@Emp_Code",      XYEEncoding.strCodeHex(empolyee.Emp_Code)),
                new SqlParameter("@Emp_Name",      XYEEncoding.strCodeHex(empolyee.Emp_Name)),
                new SqlParameter("@Emp_Password",  XYEEncoding.strCodeHex(empolyee.Emp_Password)),
                new SqlParameter("@Emp_UserRole",  XYEEncoding.strCodeHex(empolyee.Emp_UserRole)),
                new SqlParameter("@Emp_Area",      XYEEncoding.strCodeHex(empolyee.Emp_Area)),
                new SqlParameter("@Emp_zhiwen",    empolyee.Emp_zhiwen),
                new SqlParameter("@Emp_CardCode",  XYEEncoding.strCodeHex(empolyee.Emp_CardCode)),
                new SqlParameter("@Emp_Depid",     XYEEncoding.strCodeHex(empolyee.Emp_Depid)),
                new SqlParameter("@Emp_Sex",       XYEEncoding.strCodeHex(empolyee.Emp_Sex)),
                new SqlParameter("@Emp_Card",      XYEEncoding.strCodeHex(empolyee.Emp_Card)),
                new SqlParameter("@Emp_State",     empolyee.Emp_State),
                new SqlParameter("@Emp_Phone",     XYEEncoding.strCodeHex(empolyee.Emp_Phone)),
                new SqlParameter("@Emp_Bank",      XYEEncoding.strCodeHex(empolyee.Emp_Bank)),
                new SqlParameter("@Emp_OpenBank",  XYEEncoding.strCodeHex(empolyee.Emp_OpenBank)),
                new SqlParameter("@Emp_Birthday",  empolyee.Emp_Birthday),
                new SqlParameter("@Emp_Email",     XYEEncoding.strCodeHex(empolyee.Emp_Email)),
                new SqlParameter("@Emp_Education", XYEEncoding.strCodeHex(empolyee.Emp_Education)),
                new SqlParameter("@Emp_School",    XYEEncoding.strCodeHex(empolyee.Emp_School)),
                new SqlParameter("@Emp_Entry",     empolyee.Emp_Entry),
                new SqlParameter("@Emp_Enable",    empolyee.Emp_Enable),
                new SqlParameter("@Emp_Clear",     empolyee.Emp_Clear),
            };
            return(DbHelperSQL.ExecuteSql(sql, sps));
        }
Beispiel #20
0
        /// <summary>
        /// 增加信息
        /// </summary>
        /// <param name="profession">模型载体</param>
        /// <returns>受影响行数</returns>
        public int InsProfession(Profession profession)
        {
            string sql = "insert into T_Profession(ST_Code,ST_Name,ST_ParentId,ST_Enable,ST_Clear,) values(@ST_Code,@ST_Name,@ST_ParentId,@ST_Enable,@ST_Clear,)";

            SqlParameter[] sps =
            {
                new SqlParameter("@ST_Name",     XYEEncoding.strCodeHex(profession.ST_Name)),
                new SqlParameter("@ST_Code",     XYEEncoding.strCodeHex(profession.ST_Code)),
                new SqlParameter("@ST_ParentId", XYEEncoding.strCodeHex(profession.ST_ParentId)),
                new SqlParameter("@ST_Enable",   profession.ST_Enable),
                new SqlParameter("@ST_Clear",    profession.ST_Clear)
            };
            return(DbHelperSQL.ExecuteSql(sql, sps));
        }
Beispiel #21
0
        /// <summary>
        /// 根据编号更新信息
        /// </summary>
        /// <param name="profession">模型载体</param>
        /// <returns>受影响行数</returns>
        public int UpdateProfession(Profession profession)
        {
            string sql = "update T_Profession set ST_Name=@ST_Name,ST_ParentId=@ST_ParentId,ST_Enable=@ST_Enable,ST_Clear=@ST_Clear where ST_Code=@ST_Code and ST_Enable=1 and ST_Clear=1";

            SqlParameter[] sps =
            {
                new SqlParameter("@ST_Name",     XYEEncoding.strCodeHex(profession.ST_Name)),
                new SqlParameter("@ST_ParentId", XYEEncoding.strCodeHex(profession.ST_ParentId)),
                new SqlParameter("@ST_Enable",   profession.ST_Enable),
                new SqlParameter("@ST_Clear",    profession.ST_Clear),
                new SqlParameter("@ST_Code",     XYEEncoding.strCodeHex(profession.ST_Code))
            };
            return(DbHelperSQL.ExecuteSql(sql, sps));
        }
Beispiel #22
0
        private void buttonXLogin_Click(object sender, EventArgs e)
        {
            User              u        = new User();
            UserManager       um       = new UserManager();
            PermissionManager pm       = new PermissionManager();
            string            name     = textBoxXName.Text.Trim();
            string            password = textBoxXPassword.Text.Trim();

            if (string.IsNullOrWhiteSpace(name))
            {
                labelName.Visible = true;
                labelNull.Text    = "请输入用户名";
                labelNull.Visible = true;
            }
            else if (string.IsNullOrWhiteSpace(password))
            {
                labelPW.Visible   = true;
                labelNull.Text    = "请输入密码";
                labelNull.Visible = true;
            }
            else
            {
                if (!um.Exists(name))
                {
                    labelName.Visible = false;
                    labelPW.Visible   = false;
                    labelNull.Text    = "用户名不存在";
                    labelNull.Visible = true;
                    return;
                }
                DataTable user = um.GetUserAndRoleModel(name, password);
                if (user.Rows.Count > 0)
                {
                    LoginInfomation information = LoginInfomation.getInstance();
                    information.UserName = user.Rows[0]["User_Name"].ToString();
                    information.UserRole = user.Rows[0]["Role_Name"].ToString();
                    information.UserCode = user.Rows[0]["User_Code"].ToString();
                    //根据角色里的权限编码查询所拥有的权限信息
                    DataSet permission = pm.GetList("Per_Code = '" +
                                                    XYEEncoding.strCodeHex(user.Rows[0]["Role_Modules"].ToString()) + "'");
                    getPermissionList(permission);
                    Close();
                }
                else
                {
                    labelNull.Text    = "密码不正确";
                    labelNull.Visible = true;
                }
            }
        }
Beispiel #23
0
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(string C_No)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select count(1) from T_Conllection");
            strSql.Append(" where C_No=@C_No");
            SqlParameter[] parameters =
            {
                new SqlParameter("@C_No", SqlDbType.VarChar, 512)
            };
            parameters[0].Value = XYEEncoding.strCodeHex(C_No);

            return(DbHelperSQL.Exists(strSql.ToString(), parameters));
        }
Beispiel #24
0
        /// <summary>
        /// 根据编号修改信息
        /// </summary>
        /// <param name="supplier">模型载体</param>
        /// <returns>受影响行数</returns>
        public int UpdateSupplier(Supplier supplier)
        {
            string sql = string.Format(@"UPDATE T_Supplier
                                 SET Su_Name = @Su_Name
                                  ,Su_Phone = @Su_Phone
                                  ,Su_Address = @Su_Address
                                  ,Su_fax = @Su_fax
                                  ,Su_Email = @Su_Email
                                  ,Su_Bankaccounts = @Su_Bankaccounts
                                  ,Su_Bank = @Su_Bank
                                  ,Su_Profession = @Su_Profession
                                  ,Su_ProCode = @Su_ProCode
                                  ,Su_Credit = @Su_Credit
                                  ,Su_Money = @Su_Money
                                  ,Su_Surplus = @Su_Surplus
                                  ,Su_Reckoning = @Su_Reckoning
                                  ,Su_Empname = @Su_Empname
                                  ,Su_EmpPhone = @Su_EmpPhone
                                  ,Su_Remark = @Su_Remark
                                  ,Su_Enable = @Su_Enable
                                  ,Su_Clear = @Su_Clear
                                  ,Su_Area=@Su_Area
                                 WHERE Su_Code=@Su_Code");

            SqlParameter[] sps =
            {
                new SqlParameter("@Su_Name",         XYEEncoding.strCodeHex(supplier.Su_Name)),
                new SqlParameter("@Su_Phone",        XYEEncoding.strCodeHex(supplier.Su_Phone)),
                new SqlParameter("@Su_Address",      XYEEncoding.strCodeHex(supplier.Su_Address)),
                new SqlParameter("@Su_fax",          XYEEncoding.strCodeHex(supplier.Su_fax)),
                new SqlParameter("@Su_Email",        XYEEncoding.strCodeHex(supplier.Su_Email)),
                new SqlParameter("@Su_Bankaccounts", XYEEncoding.strCodeHex(supplier.Su_Bankaccounts)),
                new SqlParameter("@Su_Bank",         XYEEncoding.strCodeHex(supplier.Su_Bank)),
                new SqlParameter("@Su_Profession",   XYEEncoding.strCodeHex(supplier.Su_Profession)),
                new SqlParameter("@Su_ProCode",      XYEEncoding.strCodeHex(supplier.Su_ProCode)),
                new SqlParameter("@Su_Credit",       XYEEncoding.strCodeHex(supplier.Su_Credit)),
                new SqlParameter("@Su_Money",        XYEEncoding.strCodeHex(supplier.Su_Money)),
                new SqlParameter("@Su_Surplus",      XYEEncoding.strCodeHex(supplier.Su_Surplus)),
                new SqlParameter("@Su_Reckoning",    XYEEncoding.strCodeHex(supplier.Su_Reckoning)),
                new SqlParameter("@Su_Empname",      XYEEncoding.strCodeHex(supplier.Su_Empname)),
                new SqlParameter("@Su_EmpPhone",     XYEEncoding.strCodeHex(supplier.Su_EmpPhone)),
                new SqlParameter("@Su_Remark",       XYEEncoding.strCodeHex(supplier.Su_Remark)),
                new SqlParameter("@Su_Enable",       supplier.Su_Enable),
                new SqlParameter("@Su_Clear",        supplier.Su_Clear),
                new SqlParameter("@Su_Code",         XYEEncoding.strCodeHex(supplier.Su_Code)),
                new SqlParameter("@Su_Area",         XYEEncoding.strCodeHex(supplier.Su_Area))
            };
            return(DbHelperSQL.ExecuteSql(sql, sps));
        }
Beispiel #25
0
        /// <summary>
        /// 绑定控件
        /// </summary>
        public void bankj()
        {
            string            ID  = AppDomain.CurrentDomain.GetData("s").ToString();
            BuyPaymentManager buy = new BuyPaymentManager();

            Model.BuyPayment bu = buy.GetModel(XYEEncoding.strCodeHex(ID));
            this.textBoxOddNumbers.Text = XYEEncoding.strHexDecode(bu.Buy_Code);
            this.dateTimePicker1.Value  = Convert.ToDateTime(bu.Buy_Date);
            this.labtextboxTop1.Text    = XYEEncoding.strHexDecode(bu.Buy_SuName);
            this.labtextboxTop2.Text    = XYEEncoding.strHexDecode(bu.Buy_AmountPay);
            this.labtextboxTop6.Text    = XYEEncoding.strHexDecode(bu.Buy_AccountName);
            this.labtextboxTop7.Text    = XYEEncoding.strHexDecode(bu.Buy_AccountPaid);
            this.labtextboxTop8.Text    = XYEEncoding.strHexDecode(bu.Buy_Actmoney);
            this.labtextboxBotton1.Text = XYEEncoding.strHexDecode(bu.Buy_SalesMan);
            this.labtextboxBotton4.Text = XYEEncoding.strHexDecode(bu.Buy_AuditMan);
        }
        /// <summary>
        /// 新增申请付款单
        /// </summary>
        /// <param name="buypay"></param>
        /// <returns></returns>
        public int InsBuyPayment(BuyPayment buypay)
        {
            string sql = @"INSERT INTO T_BuyPayment  
           (Buy_Code
           ,Buy_BCode
           ,Buy_Date
           ,Buy_SuName
           ,Buy_AccountName
           ,Buy_AmountPay
           ,Buy_moneyOwed
           ,Buy_AccountPaid
           ,Buy_SalesMan
           ,Buy_Remark
           ,Buy_States
           ,Buy_Class) 
          Values
          (@Buy_Code
           ,@Buy_BCode
           ,@Buy_Date
           ,@Buy_SuName
           ,@Buy_AccountName
           ,@Buy_AmountPay
           ,@Buy_moneyOwed
           ,@Buy_AccountPaid
           ,@Buy_SalesMan
           ,@Buy_Remark
           ,@Buy_States
            ,@Buy_Class)";

            SqlParameter[] sps =
            {
                new SqlParameter("@Buy_Code",        XYEEncoding.strCodeHex(buypay.Buy_Code)),
                new SqlParameter("@Buy_BCode",       XYEEncoding.strCodeHex(buypay.Buy_BCode)),
                new SqlParameter("@Buy_Date",        (buypay.Buy_Date)),
                new SqlParameter("@Buy_SuName",      XYEEncoding.strCodeHex(buypay.Buy_SuName)),
                new SqlParameter("@Buy_AccountName", XYEEncoding.strCodeHex(buypay.Buy_AccountName)),
                new SqlParameter("@Buy_AmountPay",   XYEEncoding.strCodeHex(buypay.Buy_AmountPay)),
                new SqlParameter("@Buy_moneyOwed",   XYEEncoding.strCodeHex(buypay.Buy_moneyOwed)),
                new SqlParameter("@Buy_AccountPaid", XYEEncoding.strCodeHex(buypay.Buy_AccountPaid)),
                new SqlParameter("@Buy_SalesMan",    XYEEncoding.strCodeHex(buypay.Buy_SalesMan)),
                new SqlParameter("@Buy_Remark",      buypay.Buy_Remark),
                new SqlParameter("@Buy_States",      buypay.Buy_States),
                new SqlParameter("@Buy_Class",       buypay.Buy_Class)
            };
            return(DbHelperSQL.ExecuteSql(sql, sps));
        }
        //根据条件模糊查询
        private void toolStripButton6_Click(object sender, EventArgs e)
        {
            try
            {
                string SQLWhere   = "";
                string treeName   = treeView1.SelectedNode.Text;
                string treeTag    = treeView1.SelectedNode.Tag.ToString();
                string searchType = toolStripComboBox1.Text.Trim();
                string searchKey  = XYEEncoding.strCodeHex(toolStripTextBox3.Text.Trim());

                if (treeView1.SelectedNode == null)  //如果TreeView选中项为空
                {
                    return;
                }
                if (string.IsNullOrWhiteSpace(toolStripTextBox3.Text.Trim()))  //如果搜索关键字为空
                {
                    return;
                }
                SQLWhere += string.Format(" tm.Ma_TypeID = '{0}'", XYEEncoding.strCodeHex(treeTag));

                //模糊货品信息
                switch (searchType) //搜索框内容加密后
                {
                case "货品编号":
                    SQLWhere += string.Format(" and td.Sto_MaCode  like '%{0}%'", searchKey);
                    break;

                case "货品名称":
                    SQLWhere += string.Format(" and td.Sto_MaName like '%{0}%'", searchKey);
                    break;

                case "货品规格":
                    SQLWhere += string.Format(" and td.Sto_MaModel like '%{0}%'", searchKey);
                    break;

                default:
                    MessageBox.Show("类型选择错误,请重新选择!");
                    break;
                }
                superGridControl1.PrimaryGrid.DataSource = stock.GetList(SQLWhere);
            }
            catch (Exception)
            {
                throw;
            }
        }
 //保存并退出按钮
 private void buttonX3_Click(object sender, EventArgs e)
 {
     Model.Department dep = new Model.Department();
     try
     {
         if (_update == false)
         {
             dep.Dt_Name     = XYEEncoding.strCodeHex(this.textBoxXName.Text.Trim());
             dep.Dt_RoleCode = comboBoxEx1.SelectedValue == null ? "" : XYEEncoding.strCodeHex(comboBoxEx1.SelectedValue.ToString());
             dep.Dt_Code     = XYEEncoding.strCodeHex(BuildCode.ModuleCode("DT"));
             dep.Dt_Clear    = 1;
             int result = depm.InsDepartment(dep);
             if (result == 1)
             {
                 MessageBox.Show("部门添加成功!");
                 this.Close();
                 this.Dispose();
             }
             else
             {
                 MessageBox.Show("部门保存失败!");
             }
         }
         else
         {
             dep.Dt_Name     = this.textBoxXName.Text.Trim();
             dep.Dt_RoleCode = comboBoxEx1.SelectedValue == null ? "" : comboBoxEx1.SelectedValue.ToString();
             dep.Dt_Code     = _Department.Dt_Code;
             int r = depm.UpdateDepartment(dep);
             if (r == 1)
             {
                 MessageBox.Show("修改部门成功!");
                 this.Close();
                 this.Dispose();
             }
             else
             {
                 MessageBox.Show("修改部门失败!");
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("错误,添加或者修改错误" + ex.Message);
     }
 }
        /// <summary>
        /// 根据编号修改信息
        /// </summary>
        /// <param name="empolyee"></param>
        /// <returns></returns>
        public int UpdateDepartment(Department dep)
        {
            string sql = @"update T_Department set 
             Dt_RoleCode=@Dt_RoleCode
            ,Dt_Name=@Dt_Name
             where Dt_Code=@Dt_Code";

            SqlParameter[] sps =
            {
                new SqlParameter("@Dt_RoleCode", XYEEncoding.strCodeHex(dep.Dt_RoleCode)),
                new SqlParameter("@Dt_Name",     XYEEncoding.strCodeHex(dep.Dt_Name)),
                new SqlParameter("@Dt_Code",     XYEEncoding.strCodeHex(dep.Dt_Code)),
            };
            return(DbHelperSQL.ExecuteSql(sql, sps));

            #endregion
        }
        /// <summary>
        /// 新增信息
        /// </summary>
        /// <param name="city">模型载体</param>
        /// <returns>受影响行数</returns>
        public int InsCity(City city)
        {
            string sql = @"INSERT INTO T_City VALUES
                           (@City_Code
                           ,@City_Name
                           ,@City_ParentId
                           ,@City_Enable
                           ,@City_Clear)";

            SqlParameter[] sps =
            {
                new SqlParameter("@City_Code",     XYEEncoding.strCodeHex(city.City_Code)),
                new SqlParameter("@City_Name",     XYEEncoding.strCodeHex(city.City_Name)),
                new SqlParameter("@City_ParentId", XYEEncoding.strCodeHex(city.City_ParentId)),
                new SqlParameter("@City_Enable",   city.City_Enable),
                new SqlParameter("@City_Clear",    city.City_Clear)
            };
            return(DbHelperSQL.ExecuteSql(sql, sps));
        }