예제 #1
0
        /// <summary>
        /// 查询所有信息
        /// </summary>
        /// <returns>所有数据以DataTable的形式返回</returns>
        public DataTable SelSupplierTable()
        {
            string         sql     = @"select 
Su_Code as 编码,
Su_Name as 单位名称,
Su_Address as 通讯地址,
Su_EmpName as 联系人,
Su_EmpPhone as 联系手机,
Su_fax as 传真,
Su_Email as 邮箱,
Su_Credit as 信用等级,
Su_Money as 账款额度,
Su_Surplus as 剩余额度,
Su_Reckoning as 月结日,
Su_Area as 城市,
Su_Remark as 备注,
(case 
when Su_Enable=1 then '2A50591F3727' 
else '3635591F3727' end)
as 是否禁用
from T_Supplier where Su_Clear=1 and Su_Enable=1";
            SqlDataAdapter adapter = new SqlDataAdapter(sql, DbHelperSQL.connectionString);
            DataSet        ds      = new DataSet();

            adapter.Fill(ds, "T_Supplier");
            return(ch.DataTableReCoding(ds.Tables[0]));
        }
예제 #2
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");
        }
        /// <summary>
        /// 查询所有信息
        /// </summary>
        /// <param name="isDisplayEnable">参数:默认为true 显示所有,false显示未禁用</param>
        /// <returns>所有数据以DataTable的形式返回</returns>
        public DataTable SelBankAccount(bool isDisplayEnable)
        {
            string sql = @"select 
            Ba_ID as ID,
            Ba_Code as 编码,
            Ba_OpenBank as 开户行,
            Ba_Account as 银行账号,
            Ba_CardHolder as 持卡人,
            Ba_Remark as 备注,
            Ba_AvailablePrice as 可用金额,
            (case 
            when Ba_Enable = 1 then '2A50591F3727'
            else '3635591F3727' end)
            as 是否禁用 from T_BankAccount where Ba_Clear=1";

            if (isDisplayEnable == false)
            {
                sql += " and Ba_Enable=1";
            }
            SqlDataAdapter adapter = new SqlDataAdapter(sql, DbHelperSQL.connectionString);
            DataSet        ds      = new DataSet();

            adapter.Fill(ds, "T_BankAccount");
            return(ch.DataTableReCoding(ds.Tables[0]));
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        public DataTable SelDepartment()
        {
            string         sql     = "select * from T_Department where Dt_Clear=1";
            SqlDataAdapter adapter = new SqlDataAdapter(sql, DbHelperSQL.connectionString);
            DataSet        ds      = new DataSet();

            adapter.Fill(ds, "T_Department");
            return(ch.DataTableReCoding(ds.Tables[0]));
        }
        /// <summary>
        /// 查询最近售价
        /// </summary>
        /// <returns></returns>
        public DataTable SelPriceByMaName(string Ma_Name)
        {
            string         sql     = string.Format("select top 5 '330A59182E3F583F' as 价格类型,Sell_DiscountAPrice as 价格,Sell_Discount as 折扣率 from T_SellDetail where Sell_MaName='{0}' order by Sell_Lineno desc", XYEEncoding.strCodeHex(Ma_Name));
            SqlDataAdapter adapter = new SqlDataAdapter(sql, DbHelperSQL.connectionString);
            DataSet        ds      = new DataSet();

            adapter.Fill(ds, "T_SellDetail");
            return(ch.DataTableReCoding(ds.Tables[0]));
        }
예제 #6
0
        public DataTable SelBuyDataTable()
        {
            string         sql    = "select * from T_Buy where Buy_Clear=1";
            SqlDataAdapter dapter = new SqlDataAdapter(sql, DbHelperSQL.connectionString);
            DataSet        ds     = new DataSet();

            dapter.Fill(ds, "T_Buy");
            return(ch.DataTableReCoding(ds.Tables[0]));
        }
        /// <summary>
        /// 获得资金收款单数据列表
        /// </summary>
        public DataTable GetList()
        {
            string         strsql = (@" select Sell_ID ,  
               (case 
               when Sell_IsPay=0 then '2A502E315B0A'
               when Sell_IsPay=1 then '565B53322E315B0A'
               when Sell_IsPay=2 then '36352E315B0A'
               end
               ) as Sell_IsPay ,
               Sell_Code,
               (case 
               when Sell_Review=1 then '36352D175E2F'
               else '2A502D175E2F' end
               ) as Sell_Review ,
               Sell_Date ,       
               Sell_fukuanfangshi ,
               Sell_OddMoney,
               Sell_InMoney,
               Sell_LastMoney,
               Sell_Operation ,
               Sell_Auditman ,
               Sell_Remark ,
               Sell_ClientName ,
               Sell_Salesman
                from T_Sell where Sell_Review=1 and (Sell_IsPay=0 or Sell_IsPay=1) ");
            SqlDataAdapter adapter = new SqlDataAdapter(strsql, DbHelperSQL.connectionString);
            DataSet        ds      = new DataSet();

            adapter.Fill(ds, "T_Sell");
            return(ch.DataTableReCoding(ds.Tables[0]));
        }
예제 #8
0
        public DataTable SelBuyDataTableToCheck()
        {
            string         sql    = @"select 
buy.Buy_ID as ID,
Buy_Code as 编号,
Buy_Date as 单据日期,
(case 
when Buy_PurchaseStatus=1 then '36352D175E2F'
else '2A502D175E2F' end
) as 单据状态,
Buy_SupplierName as 供应商,
su.Su_Bank as 结算账户,
--结算账户,本次付款,总金额
tbd.Buy_AmountMoney as 总金额,
Buy_SalesMan as 业务员,
buy.Buy_Remark as 备注
from T_Buy buy
left join T_BuyDetail tbd on buy.Buy_Code=tbd.Buy_ID
left join T_Supplier su on buy.Buy_SupplierCode=su.Su_Code";
            SqlDataAdapter dapter = new SqlDataAdapter(sql, DbHelperSQL.connectionString);
            DataSet        ds     = new DataSet();

            dapter.Fill(ds, "T_Buy");
            return(ch.DataTableReCoding(ds.Tables[0]));
        }
예제 #9
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))));
        }
예제 #10
0
        /// <summary>
        /// 选择下拉框查询内容
        /// </summary>
        /// <returns></returns>
        public DataTable SelClientToTable()
        {
            string         sql     = @"select Cli_ID as 编号,Cli_Name as 客户名 ,Cli_Code  from T_Client";
            SqlDataAdapter adapter = new SqlDataAdapter(sql, DbHelperSQL.connectionString);
            DataSet        ds      = new DataSet();

            adapter.Fill(ds, "T_Client");
            return(ch.DataTableReCoding(ds.Tables[0]));
        }
예제 #11
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        public DataTable SelOrderType()
        {
            string         sql     = "select * from T_OrderType";
            SqlDataAdapter adapter = new SqlDataAdapter(sql, DbHelperSQL.connectionString);
            DataSet        ds      = new DataSet();

            adapter.Fill(ds, "T_OrderType");
            return(ch.DataTableReCoding(ds.Tables[0]));
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataTable GetListToTable(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select MT_ID,MT_Code,MT_Name,MT_ParentID,MT_Enable,MT_Clear");
            strSql.Append(" FROM T_MaterialType where MT_Enable = 1 and MT_Clear = 1");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" and " + strWhere);
            }
            SqlDataAdapter adapter = new SqlDataAdapter(strSql.ToString(), DbHelperSQL.connectionString);
            DataSet        ds1     = new DataSet();

            adapter.Fill(ds1, "T_MaterialType");
            return(ch.DataTableReCoding(ds1.Tables[0]));
        }
예제 #13
0
        /// <summary>
        /// 点击图片显示DataGirdView数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected virtual void ClickPicBox(object sender, EventArgs e)
        {
            PictureBox pb = sender as PictureBox;

            pbName = pb.Name;
            try
            {
                switch (pb.Name)
                {
                case "pictureBox1":
                    resizablePanel1.Location             = new Point(180, 110);
                    dataGridViewFujia.DataSource         = sm.SelSupplierTable2();
                    dataGridViewFujia.Columns[2].Visible = false;
                    break;

                case "pictureBox4":
                    resizablePanel1.Location     = new Point(180, 140);
                    dataGridViewFujia.DataSource = bam.SelBankAccount2();
                    break;

                case "pictureBox5":
                    resizablePanel1.Location = new Point(190, 260);
                    DataTable dt = ch.DataTableReCoding(em.SelEmp2("").Tables[0]);
                    dataGridViewFujia.DataSource = dt;
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("错误代码:3209-采购付款单选择框异常,异常信息:" + ex.Message);
            }
            if (!_btnAdd)
            {
                resizablePanel1.Visible = true;
                _btnAdd = true;
            }
            else
            {
                resizablePanel1.Size    = new System.Drawing.Size(248, 144);
                resizablePanel1.Visible = true;
                resizablePanel1.Focus();
            }
        }
예제 #14
0
        public DataTable SelBuyCancelDetailByCode()
        {
            string         sql    = string.Format(@"select * from T_BuyDetail
select
bd.Buy_Lineno as 编码,
bd.Buy_MaName as 货品名称,
bd.Buy_Model as 规格型号,
bd.Buy_Unit as 单位,
bd.Buy_CurNumber as 数量,
bd.Buy_DiscountAPrice as 单价,
bd.Buy_Discount as 折扣率,
bd.Buy_DiscountBPrice as 折后单价,
(bd.Buy_CurNumber * bd.Buy_DiscountBPrice) as 总金额
from T_BuyDetail bd
left
join T_Buy buy on buy.Buy_Code = bd.Buy_ID");
            SqlDataAdapter dapter = new SqlDataAdapter(sql, DbHelperSQL.connectionString);
            DataSet        ds     = new DataSet();

            dapter.Fill(ds, "T_BuyDetail");
            return(ch.DataTableReCoding(ds.Tables[0]));
        }
예제 #15
0
        /// <summary>
        /// 将DataSet里的第一个table解密后绑定到控件上
        /// </summary>
        /// <param name="ds"></param>
        private void bindingDGVByDataTable(DataSet ds)
        {
            if (ds.Tables.Count > 0)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    CodingHelper codingHelper = new CodingHelper();

                    superGridControl1.PrimaryGrid.DataSource =
                        codingHelper.DataTableReCoding(ds.Tables[0]);
                }
                else
                {
                    DataTable dt = ds.Tables[0].Clone();

                    CodingHelper codingHelper = new CodingHelper();

                    superGridControl1.PrimaryGrid.DataSource =
                        codingHelper.DataTableReCoding(dt);
                }
            }
        }
예제 #16
0
        /// <summary>
        /// 查询所有信息
        /// </summary>
        /// <param name="isflag">是否显示禁用:true显示所有禁用状态的信息,false仅显示未禁用状态的信息</param>
        /// <returns></returns>
        public DataTable SelEmpolyee(bool isflag)
        {
            CodingHelper ch  = new CodingHelper();
            string       sql = @"select Emp_Code as 员工工号,
            Emp_Name as 姓名,
            r.Role_Name as 角色,
            Emp_Area as 地址,
            Emp_CardCode as 卡号,
            dep.Dt_Name as 所属部门,
            Emp_Sex as 性别,
            Emp_Card as 身份证号,
            Emp_Phone as 联系电话,
            Emp_Bank as 银行卡号,
            Emp_OpenBank as 开户行,
            Emp_Birthday 出生年月,
            Emp_Email as 邮箱,
            Emp_Education as 最高学历,
            Emp_School as 毕业院校,
            Emp_Entry as 入职时间,
            Emp_State as 就职状态,
            Emp_Enable as 禁用状态  
            from T_Empolyee emp,
            T_Role r,
            T_Department dep 
            where Emp_Clear=1 
            and emp.Emp_Depid=dep.Dt_Code 
            and emp.Emp_UserRole=r.Role_Code";

            if (isflag == false)
            {
                sql += " and Emp_Enable=1";
            }
            SqlDataAdapter adapter = new SqlDataAdapter(sql, DbHelperSQL.connectionString);
            DataSet        ds      = new DataSet();

            adapter.Fill(ds, "T_Empolyee");
            return(ch.DataTableReCoding(ds.Tables[0]));
        }
        /// <summary>
        /// 获取数据列表
        /// </summary>
        /// <param name="strWhere">where条件</param>
        /// <returns></returns>
        public DataTable GetList(string strWhere)
        {
            CodingHelper ch = new CodingHelper();

            return(ch.DataTableReCoding(sds.GetList(strWhere).Tables[0]));
        }
예제 #18
0
 /// <summary>
 /// 获得数据列表
 /// </summary>
 /// <param name="strWhere">查询的where条件</param>
 /// <returns>数据列表</returns>
 public DataTable GetList(string strWhere)
 {
     return(ch.DataTableReCoding(dal.GetList(strWhere).Tables[0]));
 }
예제 #19
0
 /// <summary>
 /// 查询采购流程表
 /// </summary>
 /// <returns></returns>
 public DataTable SelBuyDataTable(string code)
 {
     return(ch.DataTableReCoding((dal.SelBuyDataTable(code))));
 }
예제 #20
0
        /// <summary>
        /// 查询所有信息
        /// </summary>
        /// <returns>所有数据以DataTable的形式返回</returns>
        public DataTable SelStockTable()
        {
            CodingHelper ch = new CodingHelper();

            return(ch.DataTableReCoding(dal.SelStockTable()));
        }