Exemplo n.º 1
0
        protected void getData()
        {
            //绑定粉碎部品数据表
            string inputArea = "inputArea = 2";
            string sqlselect = string.Format(sqlquery, inputArea);

            Debug.WriteLine(sqlselect);
            DataTable dt = new DataTable();

            dt = cmd.ExecuteDataTable(sqlselect);
            GridView1.DataSource = dt;
            GridView1.DataBind();

            string[] produceArea = new string[] { "品检不良品", "工程内不良品" };
            DropDownListArea.DataSource = produceArea;
            DropDownListArea.DataBind();

            //金额
            string sqlmoney1 = string.Format(sqlmoney, inputArea);

            Debug.WriteLine(sqlmoney1);
            double moneySum = 0;

            if (!(DBNull.Value.Equals(cmd.ExecuteScalar(sqlmoney1))))
            {
                moneySum = Convert.ToDouble(cmd.ExecuteScalar(sqlmoney1));
            }
            lblMoney.InnerText = string.Format("总金额:{0}", moneySum);

            getRoot(inputArea);
        }
Exemplo n.º 2
0
        protected void txtMNo_TextChanged(object sender, EventArgs e)
        {
            SelectCommandBuilder s = new SelectCommandBuilder("materials");

            s.SelectColumn("texture");
            s.SelectColumn("spec");
            s.SelectColumn("color");
            s.ConditionsColumn("name", txtMNo.Text.Trim().ToUpper());
            s.getSelectCommand();
            DataTable td = s.ExecuteDataTable();

            if (td != null && td.Rows.Count != 0)
            {
                txtMName.Text        = td.Rows[0]["texture"].ToString();
                txtMModel.Text       = td.Rows[0]["spec"].ToString();
                txtMVenderColor.Text = td.Rows[0]["color"].ToString();
                txtWeight.Focus();
                btnAdd.Enabled = true;
            }
            else
            {
                ClientScript.RegisterClientScriptBlock(ClientScript.GetType(), "alert", "<script>alert('材料未建档'); history.back();</script>", false);
                txtMName.Focus();
            }
        }
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            string sql = @"SELECT DISTINCT a.Bill_Id, a.Bill_no, a.Pk_id, ISNULL
                                      ((SELECT " + Resources.Resource.store + @"
                                      FROM store
                                      WHERE store_id = a.store_id), a.store_id) AS store_id, 
                                  pre_pk.pk_date AS pk_date, ISNULL
                                      ((SELECT operator_name
                                      FROM operator
                                      WHERE operator_id = a.Crt_emp), a.Crt_emp) AS Crt_emp, a.Crt_Date, a.Remark, 
                                 Status= (case when a.status ='Y' then 'true' else 'false' end) 
                            FROM tmp_pk_bill a INNER JOIN
                                  pre_pk ON a.Pk_id = pre_pk.pk_id INNER JOIN
                                  tmp_pk_detail b ON a.Bill_Id = b.Bill_id WHERE a.status <> 'A'";

            if (!string.IsNullOrEmpty(txtStartDate.Text))
            {
                sql += " WHERE (CONVERT(varchar(100),pre_pk.pk_date, 23) = '" + txtStartDate.Text + @"')";
            }
            SelectCommandBuilder s = new SelectCommandBuilder();

            gvData.DataSource = s.ExecuteDataTable(sql);
            gvData.DataBind();
            if (gvData.Rows.Count != 0)
            {
                gvData.SelectedIndex = 0;
                gvData_SelectedIndexChanged(sender, e);
            }
            gvDetailData.DataSource = null;
            gvDetailData.DataBind();
        }
Exemplo n.º 4
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string keyword = context.Request.QueryString["keyword"];

            if (keyword != null)
            {
                string sql             = "SELECT DISTINCT TOP 5 mode FROM Mold_management_accounting WHERE (mode LIKE '" + keyword + "%')";
                SelectCommandBuilder s = new SelectCommandBuilder();
                DataTable            d = s.ExecuteDataTable(sql);
                string jsonString      = "";
                if (d != null && d.Rows.Count != 0)
                {
                    jsonString += "[";
                    for (int i = 0; i < d.Rows.Count; i++)
                    {
                        if (i != d.Rows.Count - 1)
                        {
                            jsonString += '"' + d.Rows[i][0].ToString().Trim() + '"' + ",";
                        }
                        else
                        {
                            jsonString += '"' + d.Rows[i][0].ToString().Trim() + '"' + "]";
                        }
                    }
                }
                context.Response.Write(jsonString);
            }
        }
Exemplo n.º 5
0
        public string getCustomerName(string c_id)
        {
            string sql             = "select Customer_name from customer where customer_id='" + c_id + "'";
            SelectCommandBuilder s = new SelectCommandBuilder();

            return(s.ExecuteDataTable(sql).Rows[0][0].ToString());
        }
        protected string getUserMailAddress(string userName)
        {
            string mail = "";

            string[]             nameList = userName.Split(';');
            SelectCommandBuilder s        = new SelectCommandBuilder(ConnectionFactory.ConnectionString_hudsonwwwroot, "trymolde");
            string sql = "SELECT email FROM HUDSON_User";

            for (int i = 0; i < nameList.Length; i++)
            {
                if (i == 0)
                {
                    sql += " Where UserName = '******'";
                }
                else
                {
                    sql += " or UserName = '******'";
                }
            }
            DataTable dt = s.ExecuteDataTable(sql);

            if (dt != null && dt.Rows.Count != 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (!string.IsNullOrEmpty(dt.Rows[i]["email"].ToString()))
                    {
                        mail += dt.Rows[i]["email"].ToString() + ";";
                    }
                }
            }
            return(mail);
        }
Exemplo n.º 7
0
        public static string getNextId(string front_fix)
        {
            string Id = "";
            SelectCommandBuilder select = new SelectCommandBuilder("tmp_id");

            select.SelectColumn("str_bill_id");
            select.ConditionsColumn("1", 1);
            select.getSelectCommand();
            DataTable dt = select.ExecuteDataTable();

            if (dt == null || dt.Rows.Count == 0)
            {
                new InsertCommandBuilder().ExecuteNonQuery("insert into tmp_id values ('0')");
            }
            string currId = (dt != null && dt.Rows.Count != 0) ? dt.Rows[0][0].ToString() : "0";

            if (currId == "99999")
            {
                currId = "0";
            }
            int sNumber = int.Parse(currId);

            sNumber += 1;
            Id       = front_fix + DateTime.Now.ToString("yyyyMMdd") + sNumber.ToString();
            new UpdateCommandBuilder().ExecuteNonQuery("update tmp_id set str_bill_id = '" + sNumber.ToString() + "'");
            return(Id);
        }
Exemplo n.º 8
0
        public void getData(string id)
        {
            SelectCommandBuilder s = new SelectCommandBuilder("m_materials");

            s.SelectColumn("id");
            s.SelectColumn("name");
            s.SelectColumn("spec");
            s.SelectColumn("sccj_id");
            s.SelectColumn("new_price");
            s.SelectColumn("wb_name");
            s.SelectColumn("lb1_id");
            s.SelectColumn("texture");
            s.SelectColumn("color");
            s.SelectColumn("dm");
            s.ConditionsColumn("id", id);
            s.getSelectCommand();
            DataTable dt = s.ExecuteDataTable();

            if (dt != null && dt.Rows.Count != 0)
            {
                txtName.Text            = dt.Rows[0]["name"].ToString().Trim();
                txtSpec.Text            = dt.Rows[0]["spec"].ToString().Trim();
                ddlVendor.SelectedIndex = getIndex(dt.Rows[0]["sccj_id"].ToString().Trim());
                txtPrie.Text            = dt.Rows[0]["new_price"].ToString() == string.Empty ? "0.00" : Convert.ToDouble(dt.Rows[0]["new_price"]).ToString("0.00#");
                txtmoneyType.Text       = dt.Rows[0]["wb_name"].ToString().Trim();
                txttype.Text            = dt.Rows[0]["lb1_id"].ToString().Trim();
                txtCz.Text       = dt.Rows[0]["texture"].ToString().Trim();
                txtColor.Text    = dt.Rows[0]["color"].ToString().Trim();
                txtShotName.Text = dt.Rows[0]["dm"].ToString().Trim();
            }
        }
Exemplo n.º 9
0
        private void getData()
        {
            SelectCommandBuilder cmd = new SelectCommandBuilder();
            string    sql            = "select userid,name,department from shatter_Parts_Password";
            DataTable dt             = cmd.ExecuteDataTable(sql);

            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
Exemplo n.º 10
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string msg = inputValidate();

            if (msg != "")
            {
                Response.Write("<script>alert('" + msg + "')</script>");
                return;
            }
            SelectCommandBuilder select = new SelectCommandBuilder(constr, "goods_tmp");

            select.SelectColumn("goods_id");
            select.ConditionsColumn("goods_name", txtGoodsName.Text.Trim().ToUpper());
            select.getSelectCommand();
            DataTable dt       = select.ExecuteDataTable();
            string    goods_id = "";

            if (dt == null || dt.Rows.Count == 0)
            {
                Response.Write("<script>alert('部番不存在')</script>");
                return;
            }
            else
            {
                goods_id = dt.Rows[0][0].ToString();
            }
            string    sql = "SELECT sum( stock_remain.qty) as qty  FROM batch INNER JOIN stock_remain ON batch.batch_id = stock_remain.batch_id where (batch.hwh = '" + hwh.Value.Trim().ToUpper() + "') AND (stock_remain.goods_id = '" + goods_id + "') group by  stock_remain.goods_id,batch.hwh";
            DataTable ddt = new SelectCommandBuilder(constr, "").ExecuteDataTable(sql);

            if (ddt == null || ddt.Rows.Count == 0)
            {
                Response.Write("<script>alert('仓位错误')</script>");
                hwh.Focus();
                return;
            }
            else
            {
                if (Convert.ToInt32(qty.Value) > Convert.ToInt32(ddt.Rows[0]["qty"]))
                {
                    Response.Write("<script>alert('仓位数量不足')</script>");
                    qty.Focus();
                    return;
                }
            }
            inputData indata = new inputData()
            {
                goods_name = txtGoodsName.Text.Trim().ToUpper(),
                Qty        = int.Parse(qty.Value.Trim()),
                unit       = "pcs",
                goodsPost  = hwh.Value.Trim().ToUpper(),
            };

            insList.Add(indata);
            gvData.DataSource = insList;
            gvData.DataBind();
            clearText();
        }
Exemplo n.º 11
0
        protected DataTable getCustomers()
        {
            SelectCommandBuilder s = new SelectCommandBuilder("customer");

            s.SelectColumn("customer_id");
            s.SelectColumn("customer_aname");
            s.ConditionsColumn("1", "1");
            s.getSelectCommand();
            return(s.ExecuteDataTable());
        }
Exemplo n.º 12
0
        public DateTime getDate(string Pid, string khdm)
        {
            SelectCommandBuilder s = new SelectCommandBuilder("goods_up");

            s.SelectColumn("delivery_date");
            s.ConditionsColumn("khdm", khdm);
            s.ConditionsColumn("Prepare_goods_Id", Pid);
            s.getSelectCommand();
            return(Convert.ToDateTime(s.ExecuteDataTable().Rows[0][0].ToString()));
        }
Exemplo n.º 13
0
        public DataTable getStockInput()
        {
            SelectCommandBuilder s = new SelectCommandBuilder("Goods_Up");

            s.SelectColumn("goods_name");
            s.SelectColumn("qty");
            s.SelectColumn("qty");
            s.ConditionsColumn("1", "1");
            s.getSelectCommand();
            return(s.ExecuteDataTable());
        }
Exemplo n.º 14
0
        public static int getCurrentId()
        {
            SelectCommandBuilder select = new SelectCommandBuilder("tmp_id");

            select.SelectColumn("str_bill_id");
            select.ConditionsColumn("1", 1);
            select.getSelectCommand();
            int currId = int.Parse(select.ExecuteDataTable().Rows[0][0].ToString());

            return(currId);
        }
        protected void bindDDL()
        {
            string sql              = "SELECT store_id, " + Resources.Resource.store + " FROM store";
            SelectCommandBuilder s  = new SelectCommandBuilder();
            DataTable            dt = s.ExecuteDataTable(sql);

            ddlMaterialStock.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ddlMaterialStock.Items.Add(new ListItem(dt.Rows[i][1].ToString(), dt.Rows[i]["store_id"].ToString()));
            }
        }
Exemplo n.º 16
0
        protected void bindDDL()
        {
            string sql              = "SELECT store_id, store_name FROM store";
            SelectCommandBuilder s  = new SelectCommandBuilder(constr, "");
            DataTable            dt = s.ExecuteDataTable(sql);

            ddlMaterialStock.Items.Clear();
            ddlMaterialStock.Items.Add(new ListItem("请选择", "0"));
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ddlMaterialStock.Items.Add(new ListItem(dt.Rows[i]["store_name"].ToString(), dt.Rows[i]["store_id"].ToString()));
            }
        }
Exemplo n.º 17
0
        protected string getOperatoName(string operator_Id)
        {
            string name = "";

            if (!string.IsNullOrEmpty(operator_Id))
            {
                SelectCommandBuilder s = new SelectCommandBuilder("operator");
                s.SelectColumn("operator_name");
                s.ConditionsColumn("operator_id", operator_Id);
                s.getSelectCommand();
                name = s.ExecuteDataTable().Rows[0]["operator_name"].ToString();
            }
            return(name);
        }
Exemplo n.º 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string produceArea = Request.QueryString["Area"];
            string tableSign   = Request.QueryString["tableSign"];

            if (produceArea == null || tableSign == null)
            {
                Response.Redirect("query.aspx");
            }
            string inputArea1 = "inputArea = 2";
            string inputArea2 = " inputArea = 1";
            string Area       = produceArea == "品检不良品" ? inputArea1 : inputArea2;
            string sqlMoney   = string.Format(@"select sum(moneySum)  from shatter_Parts
                                where tableSign= " + tableSign
                                              + " and ({0}) and (topManagerConfirm is not null or managerConfirm is not null)", Area);
            string sql = string.Format(@"select goodsName as 部番,cz as 材料编号,spec as 材料材质,ys as 材料色番,
                                count as 不良数量,price as 单价, moneySum as 金额,produceArea as 不良发生区,
                                badContent as 不良内容,ISNULL( CONVERT(nvarchar(10),  produceTime,126),'') as 生产日期,employeeName as 作业员,
                                ISNULL( CONVERT(nvarchar(10),  inputTime,126),'') as 录入时间                                                               
                                from shatter_Parts 
left join goods on goods.goods_name = shatter_Parts.goodsName
                                where tableSign= " + tableSign
                                       + " and ({0}) and (topManagerConfirm is not null or managerConfirm is not null)", Area);
            string sqlCEOconfirm = string.Format(@"select goodsName from shatter_Parts where topManagerConfirm is not null and ({0})", Area);

            string goodsName = Convert.ToString(new SelectCommandBuilder().ExecuteScalar(sqlCEOconfirm));

            if (goodsName != "")
            {
                LabelAdmin.Text = "承认人:总经理";
            }
            else
            {
                LabelAdmin.Text = "承认人:经理";
            }
            var comm     = new SelectCommandBuilder();
            var moneySum = comm.ExecuteScalar(sqlMoney);

            LabelTime.Text = DateTime.Now.ToString("yyyy-MM-dd");

            //double moneySum = moneySum = Convert.ToDouble();
            Debug.Write(sqlMoney);
            Debug.Write(sql);
            LabelMoney.Text = string.Format("总金额:{0}", DBNull.Value.Equals(moneySum) ? 0 : Convert.ToDouble(moneySum));
            DataTable dt = comm.ExecuteDataTable(sql);

            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
Exemplo n.º 19
0
        public bool getVisible(string Pid, string khdm)
        {
            bool flag = false;

            string sql             = @"SELECT goods.goods_name AS 部番, goods_up.qty AS 交货数,
                        ISNULL(delivery_plan.plan_qty, 0) AS 计划余数, SUM(xsht_detail.qty)
                        AS 订单余数
                        FROM goods INNER JOIN
                              goods_up ON goods.goods_name = goods_up.goods_name LEFT OUTER JOIN
                              xsht_detail ON goods.goods_id = xsht_detail.goods_id INNER JOIN
                              xsht ON xsht_detail.xsht_id = xsht.xsht_id LEFT OUTER JOIN
                                  (SELECT delivery_plan.goods_id,
                                       SUM(delivery_plan.plan_qty - ISNULL(delivery_plan.delivery_qty, 0))
                                       AS plan_qty
                                 FROM delivery_plan
                                 GROUP BY delivery_plan.goods_id) delivery_plan ON
                              goods.goods_id = delivery_plan.goods_id
                        WHERE (Goods_Up.Prepare_goods_Id ='" + Pid + @"') AND (Goods_Up.khdm ='" + khdm + @"') AND (xsht.is_end = 'M') 
                        GROUP BY goods.goods_name, goods_up.qty, delivery_plan.plan_qty ";
            SelectCommandBuilder s = new SelectCommandBuilder();

            ddt = s.ExecuteDataTable(sql);
            List <bool> blist = new List <bool>();

            if (ddt != null && ddt.Rows.Count != 0)
            {
                for (int i = 0; i < ddt.Rows.Count; i++)
                {
                    if (Convert.ToInt32(ddt.Rows[i][2]) >= Convert.ToInt32(ddt.Rows[i][1]) && Convert.ToInt32(ddt.Rows[i][3]) >= Convert.ToInt32(ddt.Rows[i][1]))
                    {
                        blist.Add(true);
                        ListRemove(ddt);
                        flag = true;
                    }
                    else
                    {
                        blist.Add(false);
                    }
                }
            }
            for (int i = 0; i < blist.Count; i++)
            {
                if (blist[i] == false)
                {
                    flag = false;
                }
            }
            return(flag);
        }
Exemplo n.º 20
0
        protected void getCustomer(DropDownList ddl)
        {
            SelectCommandBuilder s = new SelectCommandBuilder(constr, "customer");

            s.SelectColumn("customer_id");
            s.SelectColumn("customer_name");
            s.ConditionsColumn("1", "1");
            s.getSelectCommand();
            DataTable d = s.ExecuteDataTable();

            for (int i = 0; i < d.Rows.Count; i++)
            {
                ddl.Items.Add(new ListItem(d.Rows[i]["customer_name"].ToString(), d.Rows[i]["customer_id"].ToString()));
            }
            ddl.DataTextField = "customer_aname";
        }
        public List <string> getCurrency()
        {
            List <string>        sList = new List <string>();
            SelectCommandBuilder s     = new SelectCommandBuilder("prd_dictate_wb");

            s.SelectColumn("wb_name");
            s.ConditionsColumn("1", 1);
            s.getSelectCommand();
            DataTable d = s.ExecuteDataTable();

            for (int i = 0; i < d.Rows.Count; i++)
            {
                sList.Add(d.Rows[i][0].ToString());
            }
            return(sList);
        }
        public double getexchangeRate(string currency)
        {
            SelectCommandBuilder s = new SelectCommandBuilder("prd_dictate_wb");
            double exchangeRate    = 0.00;

            s.SelectColumn("wb_hl");
            s.ConditionsColumn("wb_name", currency);
            s.getSelectCommand();
            DataTable dt = s.ExecuteDataTable();

            if (dt != null && dt.Rows.Count != 0)
            {
                exchangeRate = Convert.ToDouble(dt.Rows[0]["wb_hl"]);
            }
            return(exchangeRate);
        }
        public string getVendorById(string vendor_id)
        {
            string venderName      = "NULL";
            SelectCommandBuilder s = new SelectCommandBuilder("vendor");

            s.SelectColumn("vendor_name");
            s.ConditionsColumn("vendor_id", vendor_id);
            s.getSelectCommand();
            DataTable dt = s.ExecuteDataTable();

            if (dt != null && dt.Rows.Count != 0)
            {
                venderName = dt.Rows[0]["vendor_name"].ToString();
            }
            return(venderName);
        }
Exemplo n.º 24
0
        protected List <goods> getGoods()
        {
            List <goods>         gList = new List <goods>();
            SelectCommandBuilder s     = new SelectCommandBuilder(constr, "goods");
            string    sql = "select goods_Id, goods_name,mjh,goods_ename,dw,qs,Materail_Number, Materail_Name,ys, Materail_Model, Materail_Vender_Color,Materail_Color,cpdz,skdz, Drying_Temperature, Drying_Time,sk_scale,cxzq,khdm,remark,Fire_Retardant_Grade,Buyer,Toner_Model,Toner_Buyer,Rohs_Certification,Aircraft,Model_Abrasives,Version from goods_tmp";
            DataTable d   = s.ExecuteDataTable(sql);

            if (d != null && d.Rows.Count != 0)
            {
                for (int i = 0; i < d.Rows.Count; i++)
                {
                    goods g = new goods()
                    {
                        goodsId         = d.Rows[i]["goods_Id"].ToString().Trim(),
                        goods_name      = d.Rows[i]["goods_name"].ToString().Trim(),
                        mjh             = d.Rows[i]["mjh"].ToString().Trim(),
                        goods_ename     = d.Rows[i]["goods_ename"].ToString().Trim(),
                        Materail_Number = d.Rows[i]["Materail_Number"].ToString().Trim(),
                        Materail_Name   = d.Rows[i]["Materail_Name"].ToString().Trim(),
                        Materail_Model  = d.Rows[i]["Materail_Model"].ToString().Trim(),
                        ys = d.Rows[i]["ys"].ToString().Trim(),
                        Materail_Vender_Color = d.Rows[i]["Materail_Vender_Color"].ToString().Trim(),
                        Materail_Color        = d.Rows[i]["Materail_Color"].ToString().Trim(),
                        cpdz = d.Rows[i]["cpdz"].ToString() == "" ? "" : Convert.ToDouble(d.Rows[i]["cpdz"]).ToString().Trim(),
                        skdz = d.Rows[i]["skdz"].ToString() == "" ? "" : Convert.ToDouble(d.Rows[i]["skdz"]).ToString().Trim(),
                        Drying_Temperature = d.Rows[i]["Drying_Temperature"].ToString().Trim(),
                        Drying_Time        = d.Rows[i]["Drying_Time"].ToString().Trim(),
                        sk_scale           = string.IsNullOrEmpty(d.Rows[i]["sk_scale"].ToString()) ? "" : Convert.ToDouble(d.Rows[i]["sk_scale"]).ToString("0.##%").Trim(),
                        cxzq   = string.IsNullOrEmpty(d.Rows[i]["cxzq"].ToString()) ? "" : Convert.ToDouble(d.Rows[i]["cxzq"]).ToString("0.##").Trim(),
                        qs     = string.IsNullOrEmpty(d.Rows[i]["qs"].ToString()) ? "" : Convert.ToDouble(d.Rows[i]["qs"]).ToString("0.##").Trim(),
                        remark = d.Rows[i]["remark"].ToString().Trim().ToString(),
                        Fire_Retardant_Grade = d.Rows[i]["Fire_Retardant_Grade"].ToString().Trim().ToString(),
                        Buyer              = d.Rows[i]["Buyer"].ToString().Trim().ToString(),
                        Toner_Model        = d.Rows[i]["Toner_Model"].ToString().Trim().ToString(),
                        Toner_Buyer        = d.Rows[i]["Toner_Buyer"].ToString().Trim().ToString(),
                        Rohs_Certification = d.Rows[i]["Rohs_Certification"].ToString().Trim().ToString() == "有" ? "0" : "1",
                        Aircraft           = d.Rows[i]["Aircraft"].ToString().Trim().ToString(),
                        Model_Abrasives    = d.Rows[i]["Model_Abrasives"].ToString().Trim().ToString(),
                        dw      = d.Rows[i]["dw"].ToString().Trim().ToString(),
                        khdm    = d.Rows[i]["khdm"].ToString().Trim().ToString(),
                        Version = d.Rows[i]["Version"].ToString().Trim().ToString()
                    };
                    gList.Add(g);
                }
            }
            return(gList);
        }
Exemplo n.º 25
0
        private void getMaxId()
        {
            SelectCommandBuilder s  = new SelectCommandBuilder();
            DataTable            dt = s.ExecuteDataTable("SELECT MAX(vendor_id) FROM vendor");

            if (dt != null && dt.Rows.Count != 0)
            {
                long Id = 0;
                if (!string.IsNullOrEmpty(dt.Rows[0][0].ToString()))
                {
                    Id = Convert.ToInt64(dt.Rows[0][0].ToString());
                }
                Id += 1;
                string FId = Id.ToString().PadLeft(6, '0');
                vendor_id.Text = FId;
            }
        }
Exemplo n.º 26
0
        private void BindCustomer()
        {
            SelectCommandBuilder s = new SelectCommandBuilder(constr, "customer");

            s.SelectColumn("customer_id");
            s.SelectColumn("customer_aname");
            s.ConditionsColumn("1", "1");
            s.getSelectCommand();
            DataTable d = s.ExecuteDataTable();

            ddlCustomer.Items.Clear();
            ddlCustomer.Items.Add(new ListItem("请选择", "0"));
            for (int i = 0; i < d.Rows.Count; i++)
            {
                ddlCustomer.Items.Add(new ListItem(d.Rows[i]["customer_aname"].ToString(), d.Rows[i]["customer_id"].ToString()));
            }
            ddlCustomer.DataTextField = "customer_aname";
        }
Exemplo n.º 27
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         string name            = Request.QueryString["name"];
         SelectCommandBuilder s = new SelectCommandBuilder("materials_newest_price");
         s.SelectColumn("name as '部番'");
         s.SelectColumn("price as '价格'");
         s.SelectColumn("wb_name as '币种'");
         s.SelectColumn("exchange_rate as '汇率'");
         s.SelectColumn("CONVERT(varchar(100),update_date,20) as '更改日期'");
         s.ConditionsColumn("name", name);
         s.OrderColumn("update_date");
         s.getSelectCommand(OrderType.desc);
         dgvDataDetail.DataSource = s.ExecuteDataTable();
         dgvDataDetail.DataBind();
     }
 }
Exemplo n.º 28
0
        public void getPerson()
        {
            SelectCommandBuilder s = new SelectCommandBuilder(ConnectionFactory.ConnectionString_hudsonwwwroot, "HUDSON_User");

            s.SelectColumn("UserName");
            s.ConditionsColumn("user_l", "19");
            s.getSelectCommand();
            DataTable dt = s.ExecuteDataTable();

            cblPerson.Items.Clear();
            if (dt != null && dt.Rows.Count != 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    cblPerson.Items.Add(new ListItem(dt.Rows[i]["UserName"].ToString()));
                }
            }
        }
Exemplo n.º 29
0
        protected void getMode_List(string mode)
        {
            SelectCommandBuilder select = new SelectCommandBuilder();
            string sql = @"SELECT Mold_management_accounting.id, Mode_type.Mode_type_name, 
                              Mold_management_accounting.mode, Mold_management_accounting.goods_name, 
                              Mold_management_accounting.goods_no, Mold_management_accounting.qty, 
                              Mold_management_accounting.quotation_number, 
                              Mold_management_accounting.price, Mold_management_accounting.rate, 
                              Mold_management_accounting.total, Mold_management_accounting.currency, 
                              CONVERT(varchar(11), Mold_management_accounting.order_receipt_date, 120) 
                              AS order_receipt_date, CONVERT(varchar(11), 
                              Mold_management_accounting.delivery_date, 120) AS delivery_date, 
                              RTRIM(Mold_management_accounting.content_remark) AS content_remark, 
                              Mold_management_accounting.tax_rate
                        FROM Mold_management_accounting INNER JOIN
                              Mode_type ON 
                              Mold_management_accounting.type_id = Mode_type.Mode_type_id
                        WHERE (1 = 1) ";

            if (!string.IsNullOrEmpty(mode))
            {
                sql += " And mode = '" + mode + @"'";
            }
            if (!string.IsNullOrEmpty(txtCyear.Text))
            {
                sql += " And (CONVERT(varchar, order_receipt_date, 112) like '" + (txtCyear.Text + txtCmoth.Text + txtCday.Text).Trim() + "%')";
            }
            if (!string.IsNullOrEmpty(txtSyear.Text))
            {
                sql += " And (CONVERT(varchar, delivery_date, 112) like '" + (txtSyear.Text + txtSmoth.Text + txtSday.Text).Trim() + "%')";
            }
            DataTable dt = select.ExecuteDataTable(sql);

            div.Visible       = true;
            gvData.DataSource = dt;
            gvData.DataBind();
            //if (dt == null || dt.Rows.Count == 0)
            //{
            //    div.Visible = true;
            //    div.Style.Add("margin-left", "20px");
            //    div.InnerHtml = "无数据...";
            //    tags.Value = string.Empty;
            //}
        }
Exemplo n.º 30
0
        protected bool CheckLogin(string UserName, string PassWord)
        {
            bool result = false;
            SelectCommandBuilder select = new SelectCommandBuilder("UserInfo");

            select.SelectColumn("password");
            select.SelectColumn("PassWordKey");
            select.ConditionsColumn("operator_name", UserName);
            select.getSelectCommand();
            DataTable dt        = select.ExecuteDataTable();
            string    _passWord = dt.Rows[0]["password"].ToString().Trim();
            string    _key      = dt.Rows[0]["PassWordKey"].ToString().Trim();

            if (PassWord == ClassDES.Decrypt(_passWord, _key))
            {
                result = true;
            }
            return(result);
        }