/// <summary>
        /// 装载控件数据
        /// </summary>
        public void LoadData()
        {
            try
            {
                if ("" != this._BiddingSupplierCode)
                {
                    BLL.BiddingSupplier cBiddingSupplier = new BLL.BiddingSupplier();
                    cBiddingSupplier.BiddingSupplierCode = this._BiddingSupplierCode;

                    this.HideSupplierCode.Value             = cBiddingSupplier.SupplierCode;
                    this.HideBiddingSupplierCode.Value      = cBiddingSupplier.BiddingSupplierCode;
                    this.HideBiddingPrejudicationCode.Value = cBiddingSupplier.BiddingPrejudicationCode;

                    this.tdSupplierName.InnerHtml = BLL.ProjectRule.GetSupplierName(cBiddingSupplier.SupplierCode);
                    this.tdNominateUser.InnerHtml = cBiddingSupplier.NominateUser;
                    //Response.Write(BLL.ProjectRule.GetSupplierName(cBiddingSupplier.SupplierCode)+"名字:"+cBiddingSupplier.NominateUser);
                    //Response.Write("表格"+tdSupplierName.InnerHtml+"史无前例"+tdNominateUser.InnerHtml);

                    this.txtSupplierName.Value = BLL.ProjectRule.GetSupplierName(cBiddingSupplier.SupplierCode);
                    this.txtNominateUser.Value = cBiddingSupplier.NominateUser;
                }
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
            }
        }
 /// <summary>
 /// 删除数据
 /// </summary>
 public void DeleteData()
 {
     try
     {
         BLL.BiddingSupplier cBiddingSupplier = new BLL.BiddingSupplier();
         cBiddingSupplier.BiddingSupplierCode = this.HideBiddingSupplierCode.Value;
         cBiddingSupplier.BiddingSupplierDelete();
     }
     catch (Exception ex)
     {
         ApplicationLog.WriteLog(this.ToString(), ex, "");
     }
 }
        /// ****************************************************************************
        /// <summary>
        /// 提交数据
        /// </summary>
        /// ****************************************************************************
        public void SubmitData()
        {
            if (txtNumber.Value == "")
            {
                //Response.Write(Rms.Web.JavaScript.Alert(true,"合同编号不能为空"));
                throw new Exception("编号不能为空");
            }
            BLL.BiddingPrejudication cBiddingPrejudication = new BLL.BiddingPrejudication();
            cBiddingPrejudication.BiddingPrejudicationCode = this.ApplicationCode;
            cBiddingPrejudication.BiddingCode = this.BiddingCode;
            cBiddingPrejudication.Number      = this.txtNumber.Value;
            cBiddingPrejudication.UserCode    = this.UserCode;
            cBiddingPrejudication.CreateDate  = DateTime.Now.ToShortDateString();
            cBiddingPrejudication.State       = "";
            cBiddingPrejudication.Flag        = "";
            cBiddingPrejudication.dao         = this.dao;
            cBiddingPrejudication.BiddingPrejudicationSubmit();

            if (this.ApplicationCode == "")
            {
                BLL.BiddingSupplier cBiddingSupplier = new BLL.BiddingSupplier();
                cBiddingSupplier.BiddingPrejudicationCode = this.ViewState["tempCode"].ToString();
                cBiddingSupplier.dao = dao;
                EntityData entity = cBiddingSupplier._GetBiddingSuppliers();
                for (int i = 0; i < entity.CurrentTable.Rows.Count; i++)
                {
                    entity.CurrentTable.Rows[i]["BiddingPrejudicationCode"] = cBiddingPrejudication.BiddingPrejudicationCode;
                }
                dao.SubmitEntity(entity);
                this.ApplicationCode = cBiddingPrejudication.BiddingPrejudicationCode;
                this.AttachMentAdd1.SaveAttachMent(this.ApplicationCode);
                this.AttachMentAdd2.SaveAttachMent(this.ApplicationCode);
                this.AttachMentAdd3.SaveAttachMent(this.ApplicationCode);
                BLL.BiddingSystem.UpDataPrejudicationCode(cBiddingPrejudication.BiddingPrejudicationCode, this.ViewState["tempCode"].ToString());
            }
        }
Beispiel #4
0
        /// ****************************************************************************
        /// <summary>
        /// 数据加载
        /// </summary>
        /// ****************************************************************************
        private void LoadData(bool Flag)
        {
            this.CheckBox2.Visible = this.IsWSZTB;
            this.TbWSZTB.Visible   = this.IsWSZTB;
            this.GridView1.Visible = this.IsWSZTB;
            if (this.BiddingEmitCode != "")
            {
                BLL.BiddingReturn cBiddingReturn = new BLL.BiddingReturn();
                cBiddingReturn.BiddingEmitCode = this.BiddingEmitCode;
                BLL.BiddingEmit biddingemit = new BLL.BiddingEmit();
                biddingemit.BiddingEmitCode = this.BiddingEmitCode;
                this.BiddingCode            = biddingemit.BiddingCode;

                DataTable dt = cBiddingReturn.GetBiddingReturns();
                if (Flag)
                {
                    ////////////////////////////////////////////////////////////
                    BLL.BiddingDtl cBiddingDtl = new BLL.BiddingDtl();
                    cBiddingDtl.BiddingCode = this.ApplicationCode;
                    DataTable dtl;
                    dtl = cBiddingDtl.GetBiddingDtls();
                    BLL.BiddingReturn bed = new BLL.BiddingReturn();
                    bed.BiddingEmitCode = this.BiddingEmitCode;
                    DataTable det = bed.GetBiddingReturns();
                    for (int i = 0; i < dtl.Rows.Count; i++)
                    {
                        if ((det.Select(" BiddingDtlCode=" + dtl.Rows[i]["BiddingDtlCode"].ToString()).Length) == 0)
                        {
                            dtl.Rows.Remove(dt.Rows[i]);
                        }
                    }
                    ////////////////////////////////////////////////////////////
                    Bind_dgListEdit(dt);
                    this.txtTotalRemark.Text = biddingemit.TotalRemark;
                }
                else
                {
                    Bind_dgListView(dt);
                }
                dt.Dispose();
                LoadBiddingOpener(false);
                dpAllowAfterClose.SelectedValue = biddingemit.AllowAfterClose.ToString();
            }
            else
            {
                if (this.ViewState["dt"] == null)
                {
                    BLL.BiddingReturn cBiddingReturn = new BLL.BiddingReturn();
                    cBiddingReturn.BiddingEmitCode = this.ApplicationCode;
                    DataTable dt = cBiddingReturn.GetBiddingReturns();

                    //增加新列
                    dt.Columns.Add("BiddingSupplierCode", System.Type.GetType("System.String"));
                    dt.Columns.Add("State2", System.Type.GetType("System.String"));

                    BLL.BiddingPrejudication cBiddingPrejudication = new BLL.BiddingPrejudication();
                    cBiddingPrejudication.BiddingCode = this.BiddingCode;
                    DataTable dtPrejudication = cBiddingPrejudication.GetBiddingPrejudications();
                    for (int i = 0; i < dtPrejudication.Rows.Count; i++)
                    {
                        BLL.BiddingDtl bdl = new BLL.BiddingDtl();
                        bdl.BiddingCode = this.BiddingCode;
                        bdl.flag        = "1";
                        DataTable dtbdl = bdl.GetBiddingDtls();
                        for (int x = 0; x < dtbdl.Rows.Count; x++)
                        {
                            BLL.BiddingSupplier cBiddingSupplier = new BLL.BiddingSupplier();
                            cBiddingSupplier.BiddingPrejudicationCode = dtPrejudication.Rows[i][0].ToString();
                            cBiddingSupplier.Flag = "1";
                            DataTable dtSupplier = cBiddingSupplier.GetBiddingSuppliers();
                            for (int j = 0; j < dtSupplier.Rows.Count; j++)
                            {
                                DataRow dr = dt.NewRow();
                                dr["BiddingReturnCode"]   = DAL.EntityDAO.SystemManageDAO.GetNewSysCode("BiddingReturn");
                                dr["SupplierCode"]        = dtSupplier.Rows[j]["SupplierCode"].ToString();
                                dr["BiddingDtlCode"]      = dtbdl.Rows[x]["BiddingDtlCode"].ToString();
                                dr["OrderCode"]           = dtSupplier.Rows[j]["OrderCode"].ToString();
                                dr["BiddingSupplierCode"] = dtSupplier.Rows[j]["BiddingSupplierCode"].ToString();
                                dr["State2"] = dtSupplier.Rows[j]["State"].ToString();
                                dt.Rows.Add(dr);
                            }
                            dtSupplier.Dispose();
                        }
                    }
                    dtPrejudication.Dispose();
                    this.ViewState["dt"] = dt;
                    dt.Dispose();
                }
                Bind_dgListView((DataTable)this.ViewState["dt"]);
                LoadBiddingOpener(true);
            }
        }
        /// <summary>
        /// 保存数据
        /// </summary>
        public void SaveData()
        {
            try
            {
                BLL.BiddingSupplier cBiddingSupplier = new BLL.BiddingSupplier();

                string strOrderCode = "0";
                if ("" == this.HideBiddingSupplierCode.Value.Trim())
                {
                    cBiddingSupplier.BiddingPrejudicationCode = this.HideBiddingPrejudicationCode.Value;
                    int rCount = cBiddingSupplier.GetBiddingSuppliers().Rows.Count;
                    if (0 < rCount)
                    {
                        strOrderCode = (BLL.ConvertRule.ToInt(cBiddingSupplier.GetBiddingSuppliers().Rows[rCount - 1]["OrderCode"]) + 1).ToString();
                    }
                    else
                    {
                        strOrderCode = "1";
                    }
                }
                else
                {
                    cBiddingSupplier.BiddingSupplierCode = this.HideBiddingSupplierCode.Value;
                    strOrderCode = cBiddingSupplier.OrderCode;
                }
                string ss = this.HideBiddingSupplierCode.Value;
                cBiddingSupplier.BiddingSupplierCode      = this.HideBiddingSupplierCode.Value;
                cBiddingSupplier.BiddingPrejudicationCode = this.HideBiddingPrejudicationCode.Value;
                cBiddingSupplier.SupplierCode             = this.HideSupplierCode.Value;
                cBiddingSupplier.NominateUser             = this.txtNominateUser.Value;
                cBiddingSupplier.NominateDate             = DateTime.Today.ToString();
                cBiddingSupplier.UserCode  = ((User)Session["User"]).UserCode;
                cBiddingSupplier.OrderCode = strOrderCode;
                cBiddingSupplier.State     = "";
                cBiddingSupplier.Flag      = "";
                cBiddingSupplier.BiddingSupplierSubmit();
                //在选择表中新增记录
                //BLL.Bidding_SupplierDepartmentIdea bsd = new RmsPM.BLL.Bidding_SupplierDepartmentIdea();
                //bsd.BiddingSupplierCode = this.HideBiddingPrejudicationCode.Value;
                //BLL.BiddingSystem.InsertDepartMent
                //BLL.Bidding_SupplierDepartmentIdea bidd = new RmsPM.BLL.Bidding_SupplierDepartmentIdea();
                //Rms.ORMap
                //BLL.SystemRule.get
                string code = DAL.EntityDAO.SystemManageDAO.GetSysCodeByName("BiddingSupplier");
                BLL.BiddingSystem.InsertDepartMent(HideBiddingPrejudicationCode.Value, code);


                RmsPM.BLL.BiddingGradeMessage cbiddingGradeMessage = new RmsPM.BLL.BiddingGradeMessage();
                cbiddingGradeMessage.BiddingGradeMessageCode = "";
                cbiddingGradeMessage.ApplicationCode         = cBiddingSupplier.BiddingSupplierCode;
                cbiddingGradeMessage.BiddingGradeTypeCode    = "100001";
                cbiddingGradeMessage.ProjectManage           = this.txtNominateUser.Value;
                cbiddingGradeMessage.State = "1";
                cbiddingGradeMessage.BiddingGradeMessageAdd();

                //Response.Write(ss+"dfgsd"+this.HideBiddingSupplierCode.Value);
                //bidd.BiddingSupplierCode = this.HideBiddingSupplierCode.Value;
                //bidd.BiddingPrejudicationCode = this.HideBiddingPrejudicationCode.Value;
                //bidd.Bidding_SupplierDepartmentIdeaSubmit();

                txtSupplierName.Value  = "";
                HideSupplierCode.Value = "";
                txtNominateUser.Value  = "";
            }
            catch (Exception ex)
            {
                Response.Write(Rms.Web.JavaScript.Alert(true, ex.Message));
                ApplicationLog.WriteLog(this.ToString(), ex, "");
            }
        }