Beispiel #1
0
        //私有方法
        private List <CustomerSendTB> GetInfoBysql(string strsql)
        {
            DataTable ds = DBHelper.GetTable(strsql);

            List <CustomerSendTB> AllCS = new List <CustomerSendTB>();

            foreach (DataRow r in ds.Rows)
            {
                CustomerSendTB CS = new CustomerSendTB();
                CS.CEid   = Convert.ToInt32(r["CEid"]);
                CS.CusID  = r["CusID"].ToString();
                CS.ECount = Convert.ToInt32(r["ECount"]);
                object iss = r["Issettle"];
                int    cnt = Convert.ToInt32(iss);
                string ise = "";
                if (cnt == 1)
                {
                    ise = "是";
                }
                if (cnt == 0)
                {
                    ise = "否";
                }
                CS.Issettle  = ise;
                CS.EAllPrice = Convert.ToDouble(r["EAllPrice"]);
                CS.EDate     = Convert.ToDateTime(r["Edate"]);
                CS.Remark    = r["Remark"].ToString();

                CustomersService cust = new CustomersService();
                CS.Ccustomer = cust.GetCusmoerByid(Convert.ToInt32(r["CusID"].ToString()));

                AllCS.Add(CS);
            }
            return(AllCS);
        }
Beispiel #2
0
//添加的方法
    protected void TmgBtnExit_Click(object sender, ImageClickEventArgs e)
    {
        if (Page.IsValid)
        {
            CustomerSendTB CusS = new CustomerSendTB();
            CusS.CusID  = ddlCustomer.SelectedValue;
            CusS.ECount = Convert.ToInt32(txtcount.Text);

            int    count    = Convert.ToInt32(txtcount.Text);
            object obj      = DelM.GetMoney(Convert.ToInt32(ddlCustomer.SelectedValue));
            int    mon      = Convert.ToInt32(obj);
            double allprice = mon * count;

            CusS.EAllPrice = allprice;
            int iss = 0;
            if (rdoYes.Checked == true)
            {
                iss = 1;
            }
            else
            {
                iss = 0;
            }

            CusS.Issettle = iss.ToString();
            CusS.EDate    = Convert.ToDateTime(txtDate.Text);
            CusS.Remark   = txtRemark.Text;
            if (Request.QueryString["CEid"] == null)
            {
                int cnt = Sudd.InsertCustomerSend(CusS);
                if (cnt > 0)
                {
                    lblmessage.Visible = true;
                    lblmessage.Text    = "添加成功";
                    txtcount.Text      = "";
                    txtmoney.Text      = "";
                    txtDate.Text       = "";
                    txtRemark.Text     = "";
                }
            }
            if (Request.QueryString["CEid"] != null)
            {
                int CEid = Convert.ToInt32(Request.QueryString["CEid"]);
                CusS.CEid = CEid;
                int cnn = Sudd.UpdateCustomerSend(CusS);
                if (cnn > 0)
                {
                    lblmessage.Visible = true;
                    lblmessage.Text    = "修改成功";
                }
            }
        }
    }
Beispiel #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Usermanager"] == null)
        {
            Response.Redirect("~/Login.aspx");
        }
        else
        {
            if (!IsPostBack)
            { //窗体加载标签不显示
                lblmessage.Visible = false;

                //填充DropDownlist控件客户
                this.ddlCustomer.DataSource     = CusMan.GetAllCustomers();
                this.ddlCustomer.DataTextField  = "CusName";
                this.ddlCustomer.DataValueField = "CusID";
                ddlCustomer.DataBind();
                if (Request.QueryString["CEid"] == null)
                {
                    txtcount.Text  = "";
                    txtmoney.Text  = "";
                    txtDate.Text   = "";
                    txtRemark.Text = "";
                }
                if (Request.QueryString["CEid"] != null)
                {
                    int ceid = Convert.ToInt32(Request.QueryString["CEid"]);

                    CustomerSendTB CusSs = Sudd.SelectCustomerSendByCEid(ceid);
                    ddlCustomer.SelectedValue = CusSs.CusID;
                    txtcount.Text             = CusSs.ECount.ToString();
                    txtmoney.Text             = CusSs.EAllPrice.ToString();
                    string isss = CusSs.Issettle;
                    if (isss == "True")
                    {
                        rdoYes.Checked = true;
                    }
                    else
                    {
                        rdoNo.Checked = true;
                    }
                    txtDate.Text   = CusSs.EDate.ToString();
                    txtRemark.Text = CusSs.Remark;
                }
            }
        }
    }
Beispiel #4
0
        //白少杰 01-11
        //添加新记录
        public int InsertCustomerSend(CustomerSendTB CSend)
        {
            string sql = "insert into CustomerSendTB values(@CusID,@ECount,@EAllPrice,@Issettle,@Edate,@Remark)";

            SqlParameter[] para = new SqlParameter[]
            {
                new SqlParameter("@CusID", CSend.CusID),
                new SqlParameter("@ECount", CSend.ECount),
                new SqlParameter("@Issettle", CSend.Issettle),
                new SqlParameter("@EAllPrice", CSend.EAllPrice),
                new SqlParameter("@Edate", CSend.EDate),
                new SqlParameter("@Remark", CSend.Remark)
            };
            int cut = DBHelper.ExecuteCommand(sql, para);

            return(cut);
        }
Beispiel #5
0
        //白少杰 01-11
        //修改记录
        public int UpdateCustomerSend(CustomerSendTB CSend)
        {
            string sql = "Update CustomerSendTB set CusID=@CusID,ECount=@ECount,Issettle=@Issettle,EAllPrice=@EAllPrice,Edate=@Edate,Remark=@Remark where CEid=@CEid";

            SqlParameter[] para = new SqlParameter[]
            {
                new SqlParameter("@CEid", CSend.CEid),
                new SqlParameter("@CusID", CSend.CusID),
                new SqlParameter("@ECount", CSend.ECount),
                new SqlParameter("@Issettle", CSend.Issettle),
                new SqlParameter("@EAllPrice", CSend.EAllPrice),
                new SqlParameter("@Edate", CSend.EDate),
                new SqlParameter("@Remark", CSend.Remark)
            };
            int cut = DBHelper.ExecuteCommand(sql, para);

            return(cut);
        }
Beispiel #6
0
        //白少杰 01-11
        //根据CEid查询所有
        public CustomerSendTB SelectCustomerSendByCEid(int CEid)
        {
            string    str = "Select * from CustomerSendTB where CEid=@CEid";
            DataTable dt  = DBHelper.GetTable(str, new SqlParameter("@CEid", CEid));

            List <CustomerSendTB> AllCS = new List <CustomerSendTB>();

            foreach (DataRow r in dt.Rows)
            {
                CustomerSendTB CS = new CustomerSendTB();
                CS.CEid   = Convert.ToInt32(r["CEid"]);
                CS.CusID  = r["CusID"].ToString();
                CS.ECount = Convert.ToInt32(r["ECount"]);
                object iss = r["Issettle"];
                int    cnt = Convert.ToInt32(iss);
                string ise = "";
                if (cnt == 1)
                {
                    ise = "是";
                }
                if (cnt == 0)
                {
                    ise = "否";
                }
                CS.Issettle  = ise;
                CS.EAllPrice = Convert.ToDouble(r["EAllPrice"]);
                CS.EDate     = Convert.ToDateTime(r["Edate"]);
                CS.Remark    = r["Remark"].ToString();

                CustomersService cust = new CustomersService();
                CS.Ccustomer = cust.GetCusmoerByid(Convert.ToInt32(r["CusID"].ToString()));

                AllCS.Add(CS);
            }
            return(AllCS[0]);
        }
Beispiel #7
0
    protected void imgbtnsel_Click(object sender, ImageClickEventArgs e)
    {
        CustomerPianTB cp    = new CustomerPianTB();
        int            cusid = Convert.ToInt32(ddlcus.SelectedValue);
        DateTime       qtime = Convert.ToDateTime(txtstime.Text);
        DateTime       ttime = Convert.ToDateTime(txtttime.Text);

        try
        {
            if (customerpianmanager.GetCustomerPianTBById(cusid, qtime, ttime) != null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('该用户信息已存在,请确认业务员及时间。')</script>");
                return;
            }
        }
        catch (Exception ex)
        {
            try
            {
                CustomersTB cus  = customersmanager.GetCusmoerByid(cusid);
                string      name = cus.CusName; //获取客户名

                DisNoteTB dis    = disnotemanager.GetDisNoteTBById(cusid, qtime, ttime);
                double    oddmon = dis.Sum;   //获取面单费用
                string    issrt  = dis.IsSet; //获取面单费用是否已结算
                if (issrt == "是")
                {
                    cp.Remark = "面单费已结!";
                }
                else
                {
                    cp.Remark = "面单费未结!";
                }

                CustomerSentTB cs      = customersentmanager.GetCustomerSentTBById(cusid, qtime, ttime);
                double         sendmon = cs.Price;//获取发件费

                CustomerSendTB cf      = customersendmanager.GetCustomerSendTBById(cusid, qtime, ttime);
                double         givemon = cf.EAllPrice;//获取送件费

                SentTB st      = sentmanager.GetSentTBById(cusid, qtime, ttime);
                double backmon = st.Price;//获取收到付件返利

                AcceptTB at     = acceptmanager.GetAcceptTBById(cusid, qtime, ttime);
                double   accmon = at.Price;//获取派收到付件款

                IAEManagerTB ia       = iaemanagermanager.GetIAEManagerTBById(cusid, qtime, ttime);
                double       othermon = ia.Price;                                         //获取其他费用

                double allmon = oddmon + sendmon + backmon - givemon - accmon + othermon; //总计

                string ISsettle = "false";

                cp.CusID    = Convert.ToInt32(cusid);
                cp.DateMon  = ttime;
                cp.OddMon   = oddmon;
                cp.SendMon  = sendmon;
                cp.GiveMon  = givemon;
                cp.BackMon  = backmon;
                cp.AccMon   = accmon;
                cp.OtherMon = othermon;
                cp.AllMon   = allmon;
                cp.ISsettle = ISsettle;

                int cou = customerpianmanager.AddCustomerPianTBInfo(cp);
                if (cou == 1)
                {
                    allInfo             = customerpianmanager.GetAllCustomerPianTBInfo(cusid);
                    anpInfo.RecordCount = allInfo.Count();
                    BindData();
                    anpInfo.CurrentPageIndex = 1;
                }
            }
            catch (Exception)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('无该用户信息,请确认业务员及时间。')</script>");
                return;
            }
        }
    }
Beispiel #8
0
 //修改记录
 public int UpdateCustomerSend(CustomerSendTB CSend)
 {
     return(cusdd.UpdateCustomerSend(CSend));
 }
Beispiel #9
0
 //添加新记录
 public int InsertCustomerSend(CustomerSendTB CSend)
 {
     return(cusdd.InsertCustomerSend(CSend));
 }