protected void btnSave_Click(object sender, Ext.Net.DirectEventArgs e)
        {
            int?projectID = null;

            if (!string.IsNullOrEmpty(cbProject.Value.ToString()))
            {
                projectID = int.Parse(cbProject.Value.ToString());
            }
            string reason = txtReason.Text.Trim();

            XMClaimReason entity = XMClaimReasonService.getSingle(a => a.ProjectID == projectID && a.Reason == reason);

            if (entity != null)
            {
                ExtNet.Msg.Alert("提示", "已有相同的信息存在!").Show();
                return;
            }

            XMClaimReason model = new XMClaimReason();

            model.ProjectID  = projectID;
            model.Reason     = reason;
            model.IsEnable   = false;
            model.CreateID   = HozestERPContext.Current.User.CustomerID;
            model.CreateTime = DateTime.Now;
            model.UpdateID   = HozestERPContext.Current.User.CustomerID;
            model.UpdateTime = DateTime.Now;

            XMClaimReasonService.InsertXMClaimReason(model);
        }
        protected void btnEdit_Click(object sender, Ext.Net.DirectEventArgs e)
        {
            int ID        = int.Parse(txtID.Text);
            int?projectID = null;

            if (!string.IsNullOrEmpty(cbProject.Value.ToString()))
            {
                projectID = int.Parse(cbProject.Value.ToString());
            }
            string reason = txtReason.Text.Trim();

            XMClaimReason entity = XMClaimReasonService.getSingle(a => a.ID == ID);

            if (entity == null)
            {
                ExtNet.Msg.Alert("提示", "记录不存在!").Show();
                return;
            }

            entity.ProjectID  = projectID;
            entity.Reason     = reason;
            entity.CreateID   = HozestERPContext.Current.User.CustomerID;
            entity.CreateTime = DateTime.Now;
            entity.UpdateID   = HozestERPContext.Current.User.CustomerID;
            entity.UpdateTime = DateTime.Now;

            XMClaimReasonService.UpdateXMClaimReason(entity);
        }
        private void BindGrid()
        {
            var list = XMClaimReasonService.GetXMClaimNewReasonList();

            StoreReason.DataSource = list;
            StoreReason.DataBind();
        }
Example #4
0
        protected void ddXMProject_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.ddXMProject.SelectedValue.ToString().Trim().Length > 0)
            {
                //店铺数据源
                if (HozestERPContext.Current.User.CustomerID == 7 || HozestERPContext.Current.User.CustomerID == 84 || HozestERPContext.Current.User.CustomerID == 658)
                {
                    var nickList = base.XMOrderInfoAPIService.GetXMNickList("", Convert.ToInt32(true), Convert.ToInt32(this.ddXMProject.SelectedValue));
                    this.ddlNick.Items.Clear();
                    // var NickListNew = nickList.Where(p => p.nick_id != 16 && p.nick_id != 17 && p.nick_id != 18).ToList();
                    this.ddlNick.DataSource     = nickList;
                    this.ddlNick.DataTextField  = "nick";
                    this.ddlNick.DataValueField = "nick_id";
                    this.ddlNick.DataBind();
                    this.ddlNick.Items.Insert(0, new ListItem("---所有---", "-1"));
                }
                else
                {
                    //其他
                    //var xMNickList = base.XMNickService.GetMyNickListByCustomer(HozestERPContext.Current.User.CustomerID, "", 0);
                    var nickList = base.XMOrderInfoAPIService.GetXMNickListSS("", Convert.ToInt32(true), Convert.ToInt32(this.ddXMProject.SelectedValue), HozestERPContext.Current.User.CustomerID, 0);
                    this.ddlNick.Items.Clear();
                    // var NickListNew = nickList.Where(p => p.nick_id != 16 && p.nick_id != 17 && p.nick_id != 18).ToList();
                    if (nickList.Count() == 0)
                    {
                        this.ddlNick.Items.Insert(0, new ListItem("---无店铺权限---", "0"));
                    }
                    else
                    {
                        if (nickList.Count() > 0)
                        {
                            this.ddlNick.DataSource     = nickList;
                            this.ddlNick.DataTextField  = "nick";
                            this.ddlNick.DataValueField = "nick_id";
                            this.ddlNick.DataBind();
                        }
                        this.ddlNick.Items.Insert(0, new ListItem("---所有---", "99"));
                    }
                }

                int ProjectID = int.Parse(ddXMProject.SelectedValue.ToString());
                var list      = XMClaimReasonService.getList(a => a.ProjectID == ProjectID).ToList();
                foreach (GridViewRow item in grdvClaimInfo.Rows)
                {
                    DropDownList ddlReason = item.FindControl("ddlReason") as DropDownList;
                    ddlReason.DataSource     = list;
                    ddlReason.DataTextField  = "Reason";
                    ddlReason.DataValueField = "Reason";
                    ddlReason.DataBind();
                    ddlReason.Items.Insert(0, new ListItem("---所有---", "-1"));
                    ddlReason.Items[0].Selected = true;
                }
            }
        }
Example #5
0
        protected void grdvClaimInfo_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                var info = e.Row.DataItem as XMClaimInfoDetail;

                //查看详情
                CheckBoxList cblDamagedCondition = e.Row.FindControl("cblDamagedCondition") as CheckBoxList;
                DropDownList ddlReason           = e.Row.FindControl("ddlReason") as DropDownList;

                if (cblDamagedCondition != null)
                {
                    var List = base.CodeService.GetCodeListInfoByCodeTypeID(242, false);//受损情况
                    cblDamagedCondition.DataSource     = List;
                    cblDamagedCondition.DataTextField  = "CodeName";
                    cblDamagedCondition.DataValueField = "CodeID";
                    cblDamagedCondition.DataBind();

                    if (info.DamagedCondition != null)
                    {
                        string[] damagedCondition = info.DamagedCondition.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        foreach (ListItem li in cblDamagedCondition.Items)
                        {
                            if (damagedCondition.Contains(li.Value))
                            {
                                li.Selected = true;
                            }
                        }
                    }
                }

                if (ddlReason != null)
                {
                    int ProjectID = int.Parse(ddXMProject.SelectedValue);
                    var list      = XMClaimReasonService.getList(a => a.ProjectID == ProjectID).ToList();
                    ddlReason.DataSource     = list;
                    ddlReason.DataTextField  = "Reason";
                    ddlReason.DataValueField = "Reason";
                    ddlReason.DataBind();
                    ddlReason.Items.Insert(0, new ListItem("---所有---", "-1"));
                    if (string.IsNullOrEmpty(info.Reason))
                    {
                        ddlReason.Items[0].Selected = true;
                    }
                    else
                    {
                        ddlReason.SelectedValue = info.Reason;
                    }
                }
            }
        }