コード例 #1
0
        protected void lbtSave_Click(object sender, EventArgs e)
        {
            OtherPayBill opbEnt = new OtherPayBill();

            opbEnt.PayBillNo            = rtbPayBillNo.Text;
            opbEnt.PayType              = rcbPayType.SelectedValue;
            opbEnt.LogisticsCompanyName = rtbLogisticsCompanyName.Text;
            opbEnt.InvoiceNo            = rtbInvoiceNo.Text;
            opbEnt.InvoiceAmount        = Convert.ToDecimal(rntbInvoiceAmount.Text);
            opbEnt.InterfaceArray       = rtbInterfaceArray.Text;
            opbEnt.ShouldPayAmount      = Convert.ToDecimal(rntbShouldPayAmount.Text);
            opbEnt.Remark     = rtbRemark.Text;
            opbEnt.PayState   = "未付款";
            opbEnt.CreateTime = System.DateTime.Now;
            opbEnt.CreateId   = WebPortalService.CurrentUserInfo.UserID;
            opbEnt.CreateName = WebPortalService.CurrentUserInfo.Name;
            opbEnt.DoCreate();
            //付款单创建完毕后将关联的物流单的付款状态改为  已提交
            string[] temparray = opbEnt.InterfaceArray.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < temparray.Length; i++)
            {
                Logistic lEnt = Logistic.Find(temparray[i]);
                lEnt.PayState = "已提交";
                lEnt.DoUpdate();
            }
            ClientScript.RegisterStartupScript(GetType(), "submit", "window.opener.location.reload();window.close();", true);
            lbtSave.Visible = false;
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            switch (RequestActionString)
            {
            case "batchdelete":
                IList <object> idList = RequestData.GetList <object>("IdList");
                if (idList != null && idList.Count > 0)
                {
                    foreach (object obj in idList)
                    {
                        //删除付款单的时候。要把物流单的付款状态由已提交还原为未付款
                        OtherPayBill opbEnt    = OtherPayBill.Find(obj.ToString());
                        string[]     temparray = opbEnt.InterfaceArray.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                        for (int i = 0; i < temparray.Length; i++)
                        {
                            Logistic lEnt = Logistic.Find(temparray[i]);
                            lEnt.PayState = "未付款";
                            lEnt.DoUpdate();
                        }
                        opbEnt.DoDelete();
                    }
                    PageState.Add("Message", "删除成功!");
                }
                break;

            default:
                DoSelect();
                break;
            }
        }
コード例 #3
0
        string type = String.Empty; // 对象类型
        protected void Page_Load(object sender, EventArgs e)
        {
            string db = ConfigurationManager.AppSettings["ExamineDB"];

            op   = RequestData.Get <string>("op");
            id   = RequestData.Get <string>("id");
            type = RequestData.Get <string>("type");

            OtherPayBill ent = null;

            switch (RequestActionString)
            {
            case "create":
                ent            = GetPostedData <OtherPayBill>();
                ent.CreateName = UserInfo.Name;
                ent.CreateTime = System.DateTime.Now;
                ent.CreateId   = UserInfo.UserID;
                ent.PayState   = "未付款";
                ent.DoCreate();
                string[] temparray = ent.InterfaceArray.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < temparray.Length; i++)
                {
                    Logistic lEnt = Logistic.Find(temparray[i]);
                    lEnt.PayState = "已提交";
                    lEnt.DoUpdate();
                }
                break;

            default:
                break;
            }
            PageState.Add("PayBillNo", DataHelper.QueryValue("select SHHG_AimExamine.dbo.fun_GetOtherPayBillNo()"));
        }
コード例 #4
0
        string type = String.Empty; // 对象类型
        protected void Page_Load(object sender, EventArgs e)
        {
            op = RequestData.Get <string>("op");
            id = RequestData.Get <string>("id");
            OtherPayBill ent = null;

            switch (RequestActionString)
            {
            case "update":
                ent = OtherPayBill.Find(id);
                string nowPayAmount = RequestData.Get <string>("NowPayAmount");
                if (!string.IsNullOrEmpty(nowPayAmount))
                {
                    ent.AcctualPayAmount = (ent.AcctualPayAmount.HasValue ? ent.AcctualPayAmount : 0) + Convert.ToDecimal(nowPayAmount);
                    if (ent.AcctualPayAmount == ent.ShouldPayAmount)
                    {
                        ent.PayState    = "已付款";
                        ent.PayTime     = System.DateTime.Now;
                        ent.PayUserId   = UserInfo.UserID;
                        ent.PayUserName = UserInfo.Name;
                    }
                    ent.DoUpdate();
                }
                if (ent.PayType == "物流付款" && ent.PayState == "已付款")
                {
                    string[] temparray = ent.InterfaceArray.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                    for (int i = 0; i < temparray.Length; i++)
                    {
                        Logistic lEnt = Logistic.Find(temparray[i]);
                        lEnt.PayState = "已付款";
                        lEnt.DoUpdate();
                    }
                }
                break;

            default:
                break;
            }
            if (op != "c" && op != "cs")
            {
                if (!String.IsNullOrEmpty(id))
                {
                    ent = OtherPayBill.Find(id);
                    SetFormData(ent);
                    PageState.Add("PayType", ent.PayType);
                    if (ent.PayType == "物流付款")
                    {
                        string[] array = ent.InterfaceArray.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                        PageState.Add("DataList", Logistic.FindAllByPrimaryKeys(array));
                    }
                }
            }
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (RequestActionString == "batchdelete")
            {
                DoBatchDelete();
            }
            else if (RequestActionString == "duiying")
            {
                string did = RequestData.Get <string>("DId");
                string lid = RequestData.Get <string>("LId");

                Logistic ent = Logistic.TryFind(lid);
                if (ent != null)
                {
                    ent.DeliveryId = did;
                    ent.DoUpdate();
                }
            }
            else
            {
                DoSelect();
            }
        }
コード例 #6
0
        string type = String.Empty; // 对象类型

        #endregion

        #region ASP.NET 事件

        protected void Page_Load(object sender, EventArgs e)
        {
            string db = ConfigurationManager.AppSettings["ExamineDB"];

            op   = RequestData.Get <string>("op");
            id   = RequestData.Get <string>("id");
            type = RequestData.Get <string>("type");
            string Dids = Request.QueryString["Dids"];

            Logistic ent = null;

            switch (this.RequestAction)
            {
            case RequestActionEnum.Update:
                ent = this.GetMergedData <Logistic>();
                ent.DoUpdate();
                this.SetMessage("修改成功!");
                break;

            case RequestActionEnum.Insert:
            case RequestActionEnum.Create:
                ent            = this.GetPostedData <Logistic>();
                ent.DeliveryId = Dids;
                ent.DoCreate();

                //修改物流状态
                Aim.Data.DataHelper.ExecSql("update " + db + "..DeliveryOrder set LogisticState='已填写' where Id in ('" + Dids.Replace(",", "','") + "')");

                this.SetMessage("新建成功!");
                break;

            case RequestActionEnum.Delete:
                ent = this.GetTargetData <Logistic>();
                ent.DoDelete();
                this.SetMessage("删除成功!");
                return;

            default:
                if (RequestActionString == "getchild")
                {
                    string number  = RequestData.Get <string>("number");
                    string strjson = RequestData.Get <string>("child").Replace("[]", "");
                    if (strjson.Length > 0)
                    {
                        strjson = strjson.Substring(1, strjson.Length - 2);
                    }
                    if (number != "")
                    {
                        DeliveryOrder order = DeliveryOrder.FindAllByProperty("Number", number).FirstOrDefault <DeliveryOrder>();
                        if (order != null)
                        {
                            if (strjson.Length != 0 && order.Child.Substring(1, order.Child.Length - 2) != "")
                            {
                                strjson += ",";
                            }
                            strjson += order.Child.Substring(1, order.Child.Length - 2);
                        }
                    }
                    if (strjson != "")
                    {
                        strjson = "[" + strjson + "]";
                        PageState.Add("result", strjson);
                    }
                }
                break;
            }

            if (op == "c" && !string.IsNullOrEmpty(Dids))
            {
                string[]        didarry = Dids.Split(',');
                DeliveryOrder[] dorders = DeliveryOrder.FindAllByPrimaryKeys(didarry);
                if (dorders.Length > 0)
                {
                    dorders[0].Id     = "";
                    dorders[0].Number = "";
                    dorders[0].Remark = "";
                    dorders[0].State  = "";

                    //string json = "";
                    //foreach (DeliveryOrder order in dorders)
                    //{
                    //    if (order != null && !string.IsNullOrEmpty(order.Child))
                    //    {
                    //        json += order.Child.Substring(1, order.Child.Length - 2) + ",";
                    //    }
                    //}
                    //dorders[0].Child = "[" + json.Substring(0, json.Length - 1) + "]";

                    this.SetFormData(dorders[0]);

                    IList <EasyDictionary> dicts = DataHelper.QueryDictList("select Id,PCode as Code,PName as [Name],Unit,[Count] as OutCount,Remark from " + db + "..DelieryOrderPart where DId in ('" + Dids.Replace(",", "','") + "')");
                    PageState.Add("DetailList", dicts);
                }
            }
            else if (op != "c" && op != "cs")
            {
                if (!String.IsNullOrEmpty(id))
                {
                    ent = Logistic.Find(id);
                }

                this.SetFormData(ent);
            }

            PageState.Add("EDNames", SysEnumeration.GetEnumDict("EDNames"));
            PageState.Add("EDPayType", SysEnumeration.GetEnumDict("EDPayType"));
        }