Beispiel #1
0
        /// <summary>
        /// 更改销售订单的状态
        /// </summary>
        /// <param name="context"></param>
        /// <param name="soid"></param>
        /// <param name="status_id"></param>
        private void ChangeSaleOrderStatus(HttpContext context, long soid, int status_id)
        {
            if (status_id == 469)
            {
                if (AuthBLL.GetUserSaleorderAuth(LoginUserId, LoginUser.security_Level_id, soid).CanDelete == false)
                {
                    return;
                }
            }
            var result = new SaleOrderBLL().UpdateSaleOrderStatus(soid, status_id, LoginUserId);

            context.Response.Write(result);
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                thisBookMark = new IndexBLL().GetSingBook(Request.RawUrl, LoginUserId);
                var soid = Request.QueryString["id"];
                if (AuthBLL.GetUserSaleorderAuth(LoginUserId, LoginUser.security_Level_id, Convert.ToInt64(soid)).CanEdit == false)
                {
                    Response.End();
                    return;
                }

                sale_order = new crm_sales_order_dal().GetSingleSalesOrderByWhere($" and id = {soid}");
                if (sale_order != null)
                {
                    sale_udfList      = new UserDefinedFieldsBLL().GetUdf(DicEnum.UDF_CATE.SALES);
                    sale_udfValueList = new UserDefinedFieldsBLL().GetUdfValue(DicEnum.UDF_CATE.SALES, sale_order.id, sale_udfList);
                    opportunity       = new crm_opportunity_dal().GetOpportunityById(sale_order.opportunity_id);
                    if (!IsPostBack)
                    {
                        var contactList = new crm_contact_dal().GetContactByAccountId(opportunity.account_id);


                        #region  拉赋值
                        status_id.DataTextField  = "show";
                        status_id.DataValueField = "val";
                        status_id.DataSource     = dic.FirstOrDefault(_ => _.Key == "sales_order_status").Value;
                        status_id.DataBind();
                        status_id.Items.Insert(0, new ListItem()
                        {
                            Value = "0", Text = "   ", Selected = true
                        });

                        owner_resource_id.DataTextField  = "show";
                        owner_resource_id.DataValueField = "val";
                        owner_resource_id.DataSource     = dic.FirstOrDefault(_ => _.Key == "sys_resource").Value;
                        owner_resource_id.DataBind();
                        owner_resource_id.Items.Insert(0, new ListItem()
                        {
                            Value = "0", Text = "   ", Selected = true
                        });

                        // bill_country_id
                        bill_country_id.DataTextField  = "show";
                        bill_country_id.DataValueField = "val";
                        bill_country_id.DataSource     = dic.FirstOrDefault(_ => _.Key == "country").Value;
                        bill_country_id.DataBind();
                        bill_country_id.Items.Insert(0, new ListItem()
                        {
                            Value = "0", Text = "   ", Selected = true
                        });
                        bill_country_id.SelectedValue = "1";

                        ship_country_id.DataTextField  = "show";
                        ship_country_id.DataValueField = "val";
                        ship_country_id.DataSource     = dic.FirstOrDefault(_ => _.Key == "country").Value;
                        ship_country_id.DataBind();
                        ship_country_id.Items.Insert(0, new ListItem()
                        {
                            Value = "0", Text = "   ", Selected = true
                        });
                        ship_country_id.SelectedValue = "1";
                        // contact_id
                        contact_id.DataTextField  = "name";
                        contact_id.DataValueField = "id";
                        contact_id.DataSource     = contactList.Where(_ => _.is_active == 1).ToList();
                        contact_id.DataBind();
                        contact_id.Items.Insert(0, new ListItem()
                        {
                            Value = "0", Text = "   ", Selected = true
                        });
                        if (sale_order.contact_id != null)
                        {
                            contact_id.SelectedValue = sale_order.contact_id.ToString();
                        }

                        #endregion
                        billTo_use_account_address.Checked = sale_order.bill_to_use_account_address == 1;
                        shipTo_use_account_address.Checked = sale_order.ship_to_use_account_address == 1;
                        shipTo_use_bill_to_address.Checked = sale_order.ship_to_use_bill_to_address == 1;

                        status_id.SelectedValue         = sale_order.status_id.ToString();
                        owner_resource_id.SelectedValue = sale_order.owner_resource_id.ToString();
                    }
                }
                else
                {
                    Response.End();
                }
            }
            catch (Exception)
            {
                Response.End();
            }
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                // todo - 商机的重新指派

                var sid = Request.QueryString["id"];
                if (AuthBLL.GetUserSaleorderAuth(LoginUserId, LoginUser.security_Level_id, Convert.ToInt64(sid)).CanView == false)
                {
                    Response.End();
                    return;
                }
                thisBookMark = new IndexBLL().GetSingBook(Request.Url.LocalPath + "?id=" + sid, LoginUserId);

                type        = Request.QueryString["type"];
                sale_order  = new crm_sales_order_dal().GetSingleSale(long.Parse(sid));
                opportunity = new crm_opportunity_dal().GetOpportunityById(sale_order.opportunity_id);
                account     = new CompanyBLL().GetCompany(opportunity.account_id);
                quote       = new QuoteBLL().GetPrimaryQuote(opportunity.id);
                if (sale_order.contact_id != null)
                {
                    contact = new ContactBLL().GetContact((long)sale_order.contact_id);
                }
                switch (type)
                {
                case "activity":
                    actType          = "活动";
                    isShowLeft.Value = "1";
                    break;

                case "todo":
                    actType          = "待办";
                    iframeSrc        = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.TODOS + "&type=" + (int)QueryType.Todos + "&group=131&con676=" + sale_order.id + "&param1=saleorderId&param2=" + sale_order.id;
                    isShowLeft.Value = "1";
                    break;

                case "note":
                    actType          = "备注";
                    iframeSrc        = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.CRM_NOTE_SEARCH + "&type=" + (int)QueryType.CRMNote + "&group=129&con675=" + sale_order.id + "&param1=saleorderId&param2=" + sale_order.id;
                    isShowLeft.Value = "1";
                    break;

                case "ticket":
                    actType = "工单";
                    break;

                case "attachment":
                    actType   = "附件";
                    iframeSrc = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.SALES_ORDER_VIEW_ATTACHMENT + "&type=" + (int)QueryType.SalesOrderViewAttachment + "&con977=" + sale_order.id;
                    break;

                case "entry":
                    actType   = "报价项";
                    iframeSrc = "../QuoteItem/QuoteItemManage.aspx?isShow=1&quote_id=" + quote.id + "&isSaleOrder=1&sale_order_id=" + sale_order.id;
                    break;

                case "purchaseOrder":
                    actType = "采购订单";
                    break;

                default:
                    actType          = "活动";
                    type             = "activity";
                    isShowLeft.Value = "1";
                    break;
                }

                if (type.Equals("activity"))
                {
                    var typeList = new ActivityBLL().GetCRMActionType();
                    noteType.DataSource     = typeList;
                    noteType.DataTextField  = "name";
                    noteType.DataValueField = "id";
                    noteType.DataBind();
                }
            }
            catch (Exception)
            {
                Response.End();
            }
        }