Esempio n. 1
0
 protected void LinkButton1_Click1(object sender, EventArgs e)
 {
     if (Session["Comm_CGPONo"] != null)
     {
         CG_POOrder model = POSer.GetSimpListArray(string.Format("and pono='{0}'", Session["Comm_CGPONo"]))[0];
         txtAE.Text             = model.AE;
         txtPONo.Text           = model.PONo;
         Session["Comm_CGPONo"] = null;
         if (ddlContract_Type.Text == "2")
         {
             var list = contractSer.GetListArray(string.Format(" PoNo='{0}' AND Contract_Type=2", txtPONo.Text));
             if (list.Count > 0)
             {
                 var modelPetition = list[0];
                 lblError.Text = string.Format("该项目已有合同档案,合同编号:{0},合同名称:{1}, 签订日期:{2}, 存放位置:{3}",
                                               modelPetition.Contract_No, modelPetition.Contract_Name, modelPetition.Contract_Date.ToString("yyyy-MM-dd"), modelPetition.Contract_Local_String);
                 btnAdd.Enabled    = false;
                 btnUpdate.Enabled = false;
             }
             else
             {
                 btnAdd.Enabled    = true;
                 btnUpdate.Enabled = true;
                 lblError.Text     = "";
             }
         }
     }
 }
Esempio n. 2
0
        protected void LinkButton1_Click1(object sender, EventArgs e)
        {
            if (Session["Comm_CGPONo"] != null)
            {
                CG_POOrder model = POSer.GetModel(Convert.ToInt32(Session["Comm_CGPONo"]));
                txtPOGuestName.Text    = model.GuestName;
                txtPOName.Text         = model.POName;
                txtPONo.Text           = model.PONo;
                Session["Comm_CGPONo"] = null;
                #region 需要审批的需要指定该项目AE

                try
                {
                    var user = new SysUserService().getAllUserByLoginName(string.Format(" and loginName='{0}'", model.AE))[0];
                    //ddlUser.Text = user.Id.ToString();
                    //ddlUser.Enabled = false;
                    ddlPers.Text    = user.Id.ToString();
                    ddlPers.Enabled = false;
                }
                catch (Exception)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('没有找到对应的AE!');</script>");
                }
                #endregion
            }
        }
 protected void LinkButton2_Click(object sender, EventArgs e)
 {
     if (Session["Comm_CGPONo"] != null)
     {
         CG_POOrder model = POSer.GetModel(Convert.ToInt32(Session["Comm_CGPONo"]));
         txtSupplier.Text       = model.GuestName;
         txtPOName.Text         = model.POName;
         txtPONo.Text           = model.PONo;
         Session["Comm_CGPONo"] = null;
     }
 }
Esempio n. 4
0
        protected void gvList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#EAF1FD',this.style.fontWeight='';");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor,this.style.fontWeight='';");
                if (isSell)

                {
                    CG_POOrder model = e.Row.DataItem as CG_POOrder;
                    if (model.POStatue2 == CG_POOrder.ConPOStatue2)
                    {
                        e.Row.BackColor = System.Drawing.Color.Red;
                    }
                }
            }
        }
Esempio n. 5
0
        protected void gvMain_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#EAF1FD',this.style.fontWeight='';");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor,this.style.fontWeight='';");

                CG_POOrder model = e.Row.DataItem as CG_POOrder;
                if (model.POStatue3 == CG_POOrder.ConPOStatue3)
                {
                    e.Row.BackColor = System.Drawing.Color.Red;
                }



                if (model.IsSpecial)
                {
                    (e.Row.FindControl("lblSpecial") as Label).BackColor = System.Drawing.Color.Blue;
                }
            }
        }
        protected void gvMain_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#EAF1FD',this.style.fontWeight='';");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor,this.style.fontWeight='';");


                CG_POOrder model = e.Row.DataItem as CG_POOrder;
                if (model.MaoliTotal < 0)
                {
                    e.Row.Cells[14].BackColor = System.Drawing.Color.Khaki;
                }
                DropDownList drp = (DropDownList)e.Row.FindControl("dllFPstye");
                if (ViewState["isFPTypeEdist"] != null)
                {
                    drp.Enabled = false;
                }
                drp.DataSource     = gooQGooddList;
                drp.DataTextField  = "FpType";
                drp.DataValueField = "FpType";
                drp.DataBind();
                //  选中 DropDownList
                try
                {
                    var hidTxt = ((HiddenField)e.Row.FindControl("hidtxt")).Value;
                    if (hidTxt == "")
                    {
                        drp.SelectedIndex = allFpTypes.IndexOf("增值税发票");
                    }
                    else
                    {
                        drp.SelectedIndex = allFpTypes.IndexOf(hidTxt);
                    }
                }
                catch (Exception)
                {
                }
            }
        }
Esempio n. 7
0
        protected void LinkButton1_Click1(object sender, EventArgs e)
        {
            if (Session["Comm_CGPONo"] != null)
            {
                CG_POOrder model = POSer.GetSimpListArray(string.Format("and pono='{0}'", Session["Comm_CGPONo"]))[0];
                txtAE.Text        = model.AE;
                txtPONo.Text      = model.PONo;
                txtGuestName.Text = model.GuestName;
                txtName.Text      = model.POName;
                //var list = POSer.GetOrder_ToInvoice_1(string.Format(" PONo='{0}'", model.PONo));
                //if (list.Count > 0)
                //{
                //    txtTotal.Text = (list[0].POTotal - list[0].TuiTotal).ToString();
                //}
                var supplierList = new CAI_POCaiService().GetLastSupplier(string.Format("'{0}'", model.PONo));
                txtSalesUnit.Text      = string.Join(",", supplierList.Select(t => t.Supplier).ToArray());
                txtTotal.Text          = supplierList.Sum(t => t.Total).ToString();
                Session["Comm_CGPONo"] = null;

                var list = petitionsSer.GetListArray(string.Format(" PoNo='{0}'", txtPONo.Text), "", "");
                if (list.Count > 0)
                {
                    var modelPetition = list[0];
                    lblError.Text = string.Format("该项目已有签呈单,签呈单编号:{0},签呈单名称:{1}, 签订日期:{2}, 存放位置:{3}",
                                                  modelPetition.Number, modelPetition.Name, modelPetition.SignDate.ToString("yyyy-MM-dd"), modelPetition.Local_String);
                    btnAdd.Enabled    = false;
                    btnUpdate.Enabled = false;
                }
                else
                {
                    btnAdd.Enabled    = true;
                    btnUpdate.Enabled = true;
                    lblError.Text     = "";
                }
            }
        }