Beispiel #1
0
        //根据SQL语句查找所有信息
        public static List <CustomerPianTB> GetAllCustomerPianTBBySql(string strsql)
        {
            List <CustomerPianTB> allinfo = new List <CustomerPianTB>();

            DataTable dt = DBHelper.GetTable(strsql);

            foreach (DataRow row in dt.Rows)
            {
                CustomersService cus = new CustomersService();
                CustomerPianTB   t   = new CustomerPianTB();
                t.CPid     = Convert.ToInt32(row["cpid"]);
                t.CusID    = Convert.ToInt32(row["cusid"]);
                t.DateMon  = Convert.ToDateTime(row["datemon"]);
                t.OddMon   = Convert.ToDouble(row["oddmon"]);
                t.SendMon  = Convert.ToDouble(row["sendmon"]);
                t.GiveMon  = Convert.ToDouble(row["givemon"]);
                t.BackMon  = Convert.ToDouble(row["backmon"]);
                t.AccMon   = Convert.ToDouble(row["accmon"]);
                t.OtherMon = Convert.ToDouble(row["othermon"]);
                t.AllMon   = Convert.ToDouble(row["allmon"]);
                t.ISsettle = row["issettle"].ToString();
                if (t.ISsettle == "True")
                {
                    t.ISsettle = "已付";
                }
                else
                {
                    t.ISsettle = "未付";
                }
                t.Remark   = row["remark"].ToString();
                t.customer = cus.GetCusmoerByid(Convert.ToInt32(row["cusid"]));
                allinfo.Add(t);
            }
            return(allinfo);
        }
Beispiel #2
0
        //插入信息
        public int AddCustomerPianTBInfo(CustomerPianTB cp)
        {
            int    count;
            string sql = "insert into CustomerPianTB(CusID,DateMon,OddMon,SendMon,GiveMon,BackMon,AccMon,OtherMon,AllMon,ISsettle,Remark) values(@CusID,@DateMon,@OddMon,@SendMon,@GiveMon,@BackMon,@AccMon,@OtherMon,@AllMon,@ISsettle,@Remark)";

            try
            {
                SqlParameter[] paras = new SqlParameter[]
                {
                    new SqlParameter("@CusID", cp.CusID),
                    new SqlParameter("@DateMon", cp.DateMon),
                    new SqlParameter("@OddMon", cp.OddMon),
                    new SqlParameter("@SendMon", cp.SendMon),
                    new SqlParameter("@GiveMon", cp.GiveMon),
                    new SqlParameter("@BackMon", cp.BackMon),
                    new SqlParameter("@AccMon", cp.AccMon),
                    new SqlParameter("@OtherMon", cp.OtherMon),
                    new SqlParameter("@AllMon", cp.AllMon),
                    new SqlParameter("@ISsettle", cp.ISsettle),
                    new SqlParameter("@Remark", cp.Remark)
                };
                DBHelper.ExecuteCommand(sql, paras);
                return(count = 1);
            }
            catch (Exception e)
            {
                return(count = 0);

                Console.Write(e.Message);
                throw e;
            }
        }
Beispiel #3
0
        //更新结算信息
        public int UpdateCustomerPianTBById(CustomerPianTB cp)
        {
            string sql = "update CustomerPianTB set CusID=@CusID,DateMon=@DateMon,OddMon=@OddMon,SendMon=@SendMon,GiveMon=@GiveMon,BackMon=@BackMon,AccMon=@AccMon,OtherMon=@OtherMon,AllMon=@AllMon,ISsettle=@ISsettle,Remark=@Remark where CPid=@CPid";

            SqlParameter[] paras = new SqlParameter[]
            {
                new SqlParameter("@CPid", cp.CPid),
                new SqlParameter("@CusID", cp.CusID),
                new SqlParameter("@DateMon", cp.DateMon),
                new SqlParameter("@OddMon", cp.OddMon),
                new SqlParameter("@SendMon", cp.SendMon),
                new SqlParameter("@GiveMon", cp.GiveMon),
                new SqlParameter("@BackMon", cp.BackMon),
                new SqlParameter("@AccMon", cp.AccMon),
                new SqlParameter("@OtherMon", cp.OtherMon),
                new SqlParameter("@AllMon", cp.AllMon),
                new SqlParameter("@ISsettle", cp.ISsettle),
                new SqlParameter("@Remark", cp.Remark)
            };
            return(DBHelper.ExecuteCommand(sql, paras));
        }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        CustomerPianTB cp = new CustomerPianTB();

        cp.CPid     = Convert.ToInt32(Label14.Text);
        cp.CusID    = Convert.ToInt32(lbl1.Text);
        cp.OddMon   = Convert.ToDouble(Label4.Text);
        cp.SendMon  = Convert.ToDouble(Label8.Text);
        cp.GiveMon  = Convert.ToDouble(Label9.Text);
        cp.BackMon  = Convert.ToDouble(Label10.Text);
        cp.AccMon   = Convert.ToDouble(Label11.Text);
        cp.OtherMon = Convert.ToDouble(Label12.Text);
        cp.AllMon   = Convert.ToDouble(Label13.Text);
        cp.ISsettle = "true";
        cp.DateMon  = Convert.ToDateTime(Label7.Text);
        cp.Remark   = "面单费已结!";
        int count = customerpianmanager.UpdateCustomerPianTBById(cp);

        if (count > 0)
        {
            lblinfos.Text = "结算成功!";
            List <CustomerPianTB> p = customerpianmanager.GetAllCustomerPianTBInfo(id);
            Label14.Text = p[0].CPid.ToString();
            lbl1.Text    = p[0].CusID.ToString();
            Label4.Text  = p[0].OddMon.ToString();
            Label8.Text  = p[0].SendMon.ToString();
            Label9.Text  = p[0].GiveMon.ToString();
            Label10.Text = p[0].BackMon.ToString();
            Label11.Text = p[0].AccMon.ToString();
            Label12.Text = p[0].OtherMon.ToString();
            Label13.Text = p[0].AllMon.ToString();
            Label5.Text  = p[0].ISsettle.ToString();
            Label7.Text  = p[0].DateMon.ToString();
            Label6.Text  = p[0].Remark.ToString();
        }
    }
Beispiel #5
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;
            }
        }
    }
 //更新结算信息
 public int UpdateCustomerPianTBById(CustomerPianTB cp)
 {
     return(customerpianservice.UpdateCustomerPianTBById(cp));
 }
 public int AddCustomerPianTBInfo(CustomerPianTB cp)
 {
     return(customerpianservice.AddCustomerPianTBInfo(cp));
 }