Beispiel #1
0
        public static DataTable GetBiddingSupplierByPrejudicationCode(string PrejudicatonCode)
        {
            BiddingSupplier supplier = new BiddingSupplier();

            supplier.BiddingPrejudicationCode = PrejudicatonCode;
            return(supplier.GetBiddingSuppliersOrderBypy());
        }
Beispiel #2
0
    /// <summary>
    /// DataGrid 事件
    /// </summary>
    /// <param name="source"></param>
    /// <param name="e"></param>
    public void dgList_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
    {
        try
        {
            if ("Delete" == e.CommandName)
            {
                string strCode = e.Item.Cells[0].Text.Trim();


                if ("" == strCode)
                {
                    return;
                }

                RmsPM.BLL.BiddingSupplier cbs = new RmsPM.BLL.BiddingSupplier();
                cbs.BiddingSupplierCode = strCode;
                cbs.BiddingSupplierDelete();

                this.LoadData();
            }
        }
        catch (Exception ex)
        {
            ApplicationLog.WriteLog(this.ToString(), ex, "");
        }
    }
Beispiel #3
0
    public void InitControl()
    {
        DataTable dt = new DataTable();



        RmsPM.BLL.BiddingPrejudication cBiddingPrejudication = new RmsPM.BLL.BiddingPrejudication();
        cBiddingPrejudication.BiddingCode = this.BiddingCode;
        DataTable dtPrejudication = cBiddingPrejudication.GetBiddingPrejudications();

        for (int i = 0; i < dtPrejudication.Rows.Count; i++)
        {
            RmsPM.BLL.BiddingSupplier cBiddingSupplier = new RmsPM.BLL.BiddingSupplier();
            cBiddingSupplier.BiddingPrejudicationCode = dtPrejudication.Rows[i][0].ToString();

            DataTable dtSupplier = cBiddingSupplier.GetBiddingSuppliers();
            if (i == 0)
            {
                dt = dtSupplier.Clone();
                dt.Columns.Add("Remark", System.Type.GetType("System.String"));
            }
            for (int j = 0; j < dtSupplier.Rows.Count; j++)
            {
                DataRow dr = dt.NewRow();
                dr.ItemArray = dtSupplier.Rows[j].ItemArray;
                dr["Remark"] = dtPrejudication.Rows[i]["Remark"].ToString();
                dt.Rows.Add(dr);
            }
            dtSupplier.Dispose();
        }

        this.dgList.DataSource = dt;
        this.dgList.DataBind();
    }
Beispiel #4
0
 /// <summary>
 /// 更新要选择发标的商家
 /// </summary>
 public void UpdateBiddingEmitSup()
 {
     for (int i = 0; i < dgListView.Items.Count; i++)
     {
         BLL.BiddingSupplier BSup = new RmsPM.BLL.BiddingSupplier();
         BSup.BiddingSupplierCode = this.dgListView.DataKeys[i].ToString();
         string stat = "0";
         if (((CheckBox)dgListView.Items[i].FindControl("CheckBox1")).Checked == true)
         {
             stat = "1";
         }
         BSup.State = stat;
         BSup.BiddingSupplierUpdate();
     }
 }
Beispiel #5
0
        /// ****************************************************************************
        /// <summary>
        /// 提交数据
        /// </summary>
        /// ****************************************************************************
        public void SubmitData()
        {
            if (this.ApplicationCode != "")
            {
                DAL.QueryStrategy.BiddingReturnStrategyBuilder sb = new RmsPM.DAL.QueryStrategy.BiddingReturnStrategyBuilder();
                sb.AddStrategy(new Strategy(DAL.QueryStrategy.BiddingReturnStrategyName.BiddingCode, this.BiddingCode));

                string sql = sb.BuildMainQueryString();

                EntityData entity = new EntityData("BiddingReturn");
                dao.FillEntity(sql, entity);
                //删除原有排名
                BLL.BiddingSystem.DelHistoryPlace(this.BiddingCode);
                //产生一张新表
                DataTable dt = new DataTable();
                dt.Columns.Add("BiddingReturnCode", System.Type.GetType("System.String"));
                dt.Columns.Add("Money", System.Type.GetType("System.Decimal"));
                dt.Columns.Add("Remark", System.Type.GetType("System.String"));
                dt.Columns.Add("ReturnDate", System.Type.GetType("System.String"));
                dt.Columns.Add("State", System.Type.GetType("System.String"));
                dt.Columns.Add("BiddingDtlCode", System.Type.GetType("System.String"));
                DataRow dr;
                //读取表中信息,并产生排名
                for (int i = 0; i < this.dgListEdit.Items.Count; i++)
                {
                    dr = dt.NewRow();
                    dr["BiddingReturnCode"] = this.dgListEdit.Items[i].Cells[0].Text.Trim();
                    dr["Money"]             = this.GetControl(i).TotalMoney;
                    dr["Remark"]            = ((HtmlTextArea)this.dgListEdit.Items[i].FindControl("txtRemark")).Value.Trim();
                    dr["ReturnDate"]        = ((AspWebControl.Calendar) this.dgListEdit.Items[i].FindControl("txtReturnDate")).Value;
                    dr["BiddingDtlCode"]    = this.dgListEdit.Items[i].Cells[8].Text.Trim();
                    //dr["State"]=i+1;
                    dt.Rows.Add(dr);
                }
                BLL.Bidding bd = new BLL.Bidding();
                bd.BiddingCode = this.BiddingCode;
                BLL.BiddingReturn br = new BLL.BiddingReturn();
                br.BiddingEmitCode = bd.BiddingLastEmit;
                DataTable dtreturn = br.GetBiddingReturns();
                foreach (DataRow drr in dtreturn.Rows)
                {
                    if (dt.Select("BiddingReturnCode ='" + drr["BiddingReturnCode"].ToString() + "'").Length == 0)
                    {
                        dr = dt.NewRow();
                        dr["BiddingReturnCode"] = drr["BiddingReturnCode"];
                        dr["BiddingDtlCode"]    = drr["BiddingDtlCode"];
                        dr["Money"]             = drr["Money"];
                        dr["Remark"]            = drr["Remark"];
                        dr["ReturnDate"]        = drr["ReturnDate"];
                        //dr.ItemArray.CopyTo(drr.ItemArray, 0);
                        dt.Rows.Add(dr);
                    }
                }


                DataView dv = new DataView(dt);

                dv.Sort = "BiddingDtlCode,Money";
                //for(int i=0;i<dv.Rows.Count;i++)
                int     j            = 0;
                string  tempBDtlCode = "";
                decimal tempMoney    = 0;

                foreach (DataRowView dr2 in dv)
                {
                    if (tempBDtlCode != dr2["BiddingDtlCode"].ToString())
                    {
                        tempBDtlCode = dr2["BiddingDtlCode"].ToString();
                        j            = 0;
                        tempMoney    = 0;
                    }


                    DataRow[] dr1 = entity.CurrentTable.Select("BiddingReturnCode='" + dr2["BiddingReturnCode"].ToString() + "' and " + "BiddingDtlCode='" + dr2["BiddingDtlCode"].ToString() + "'");

                    if (dr1.Length > 0)
                    {
                        dr1[0]["Money"]      = dr2["Money"];
                        dr1[0]["Remark"]     = dr2["Remark"];
                        dr1[0]["ReturnDate"] = dr2["ReturnDate"];
                        //State字段中存放商务标排名,规则为:如果回标金额为0或者为空时不参与商务标排名;金额一样的单位,名次一样。
                        if (!dr2["Money"].ToString().Equals("0") && !dr2["Money"].ToString().Equals(""))
                        {
                            if (tempMoney != System.Convert.ToDecimal(dr2["Money"]))
                            {
                                j++;
                            }
                            dr1[0]["State"] = j;
                        }
                        else
                        {
                            dr1[0]["State"] = "";
                        }
                        tempMoney = System.Convert.ToDecimal(dr2["Money"]);
                    }
                }

                dao.SubmitEntity(entity);
                BLL.Bidding bidding = new BLL.Bidding();
                bidding.BiddingCode = this.BiddingCode;
                bidding.State       = NowState;
                bidding.dao         = dao;
                bidding.BiddingSubmit();
                //更新备注
                BLL.BiddingEmit addRemark = new RmsPM.BLL.BiddingEmit();
                addRemark.BiddingEmitCode = this.BiddingEmitCode;
                addRemark.TotalRemark     = this.txtTotalRemark.Text;
                addRemark.dao             = dao;
                addRemark.BiddingEmitUpdate();
            }
            else
            {
                //删除历史排序记录
                BLL.BiddingSystem.DelHistoryPlace(this.BiddingCode);
                DataTable           dt   = (DataTable)ViewState["dt"];
                BLL.BiddingSupplier BSup = new RmsPM.BLL.BiddingSupplier();

                DAL.QueryStrategy.BiddingReturnStrategyBuilder sb = new RmsPM.DAL.QueryStrategy.BiddingReturnStrategyBuilder();
                sb.AddStrategy(new Strategy(DAL.QueryStrategy.BiddingReturnStrategyName.BiddingEmitCode, this.BiddingEmitCode));

                string sql = sb.BuildMainQueryString();

                EntityData entity = new EntityData("BiddingReturn");
                dao.FillEntity(sql, entity);

                if (dt.Rows.Count > 0)
                {
                    dao.DeleteAllRow(entity);
                    dao.SubmitEntity(entity);
                    string stat = "0";
                    string tempsuppliercodestr = "";
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if (((CheckBox)dgListView.Items[i].FindControl("CheckBox1")).Checked == true)
                        {
                            DataRow dr = entity.GetNewRecord();
                            dr["BiddingReturnCode"] = dt.Rows[i]["BiddingReturnCode"].ToString();
                            dr["BiddingDtlCode"]    = dt.Rows[i]["BiddingDtlCode"].ToString();
                            dr["SupplierCode"]      = dt.Rows[i]["SupplierCode"].ToString();
                            dr["OrderCode"]         = dt.Rows[i]["OrderCode"].ToString();
                            dr["BiddingEmitCode"]   = this.BiddingEmitCode;
                            dr["Abnegate"]          = 0;
                            entity.AddNewRecord(dr);
                            //更新供应商表
                            stat = "1";


                            //添加评分信息
                            RmsPM.BLL.BiddingGradeMessage cbiddingGradeMessage = new RmsPM.BLL.BiddingGradeMessage();

                            cbiddingGradeMessage.ApplicationCode      = dt.Rows[i]["BiddingReturnCode"].ToString();
                            cbiddingGradeMessage.BiddingGradeTypeCode = "100002";
                            if (cbiddingGradeMessage.GetBiddings().Rows.Count == 0)
                            {
                                cbiddingGradeMessage.BiddingGradeMessageCode = "";
                                cbiddingGradeMessage.ProjectManage           = "";
                                cbiddingGradeMessage.State = "1";
                                cbiddingGradeMessage.dao   = dao;
                                cbiddingGradeMessage.BiddingGradeMessageAdd();
                            }

                            ////////////////网上招投标数据产生////////////////////
                            if (tempsuppliercodestr.IndexOf(dt.Rows[i]["SupplierCode"].ToString()) == -1 && this.CheckBox2.Checked)
                            {
                                tempsuppliercodestr += "," + dt.Rows[i]["SupplierCode"].ToString();
                                EmitToInsert(dt.Rows[i]["SupplierCode"].ToString(), this.BiddingEmitCode);
                            }
                            ///////////////////////////////////////////////////////
                        }
                        //更新供应商列表

                        BSup.BiddingSupplierCode = this.dgListView.DataKeys[i].ToString();
                        BSup.State = stat;
                        BSup.dao   = dao;
                        BSup.BiddingSupplierUpdate();



                        //BSup.BiddingSupplierUpdate();
                    }
                    dao.SubmitEntity(entity);
                    entity.Dispose();
                }

                //保存开标人
                if (this.CheckBox2.Checked)
                {
                    BiddingBFL.Emit_SendMail(this.BiddingEmitCode, Server.MapPath(ConfigurationManager.AppSettings["VirtualDirectory"].ToString()) + @"\EmailTemplate.xml");
                    foreach (ListItem opener in chkOpener.Items)
                    {
                        if (opener.Selected)
                        {
                            BiddingBFL.InsertBiddingOpener(this.BiddingEmitCode, opener.Value);
                        }
                    }
                }
            }
        }
    /// ****************************************************************************
    /// <summary>
    /// 提交数据
    /// </summary>
    /// ****************************************************************************
    public override string SubmitData()
    {
        try
        {
            string ErrMsg = "";

            if (txtNumber.Value == "")
            {
                //Response.Write(Rms.Web.JavaScript.Alert(true,"合同编号不能为空"));
                ErrMsg = "编号不能为空";
                return(ErrMsg);
            }
            if (!this.UCBiddingSupplierList1.SelectedSupplierFlag && this.State1 == ModuleState.Operable)
            {
                ErrMsg = "请选择预审通过单位";

                return(ErrMsg);
            }
            if (this.State == ModuleState.Operable)
            {
                RmsPM.BLL.Bidding cBidding = new RmsPM.BLL.Bidding();
                cBidding.BiddingCode = this.BiddingCode;
                cBidding.ConfirmDate = this.TxtEmitDate.Text;

                cBidding.BiddingSubmit();


                RmsPM.BLL.BiddingPrejudication cBiddingPrejudication = new RmsPM.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 == "")
                {
                    RmsPM.BLL.BiddingSupplier cBiddingSupplier = new RmsPM.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;

                    RmsPM.BLL.BiddingSystem.UpDataPrejudicationCode(cBiddingPrejudication.BiddingPrejudicationCode, this.ViewState["tempCode"].ToString());
                }
            }


            if (SetAttachList1 == ModuleState.Operable)
            {
                this.AttachMentAdd1.SaveAttachMent(this.ApplicationCode);
            }
            if (SetAttachList2 == ModuleState.Operable)
            {
                this.AttachMentAdd2.SaveAttachMent(this.ApplicationCode);
            }
            if (SetAttachList3 == ModuleState.Operable)
            {
                this.AttachMentAdd3.SaveAttachMent(this.ApplicationCode);
            }


            if (this.State1 == ModuleState.Operable)
            {
                //this.BiddingPrejudicationModify1.ApplicationCode = this.ApplicationCode;
                //this.BiddingPrejudicationModify1.dao = dao;
                //this.SubmitBiddingState();
                this.UCBiddingSupplierList1.BiddingPrejudicationCode = this.ApplicationCode;
            }
            if (this.UCBiddingSupplierList1.CanModify)
            {
                this.UCBiddingSupplierList1.dao = this.dao;
                this.UCBiddingSupplierList1.ModifyData();
            }
            if (this.UCBiddingSupplierList1.CanSelect)
            {
                this.UCBiddingSupplierList1.dao = this.dao;
                this.UCBiddingSupplierList1.SaveData();
            }
            //DataGridShowState();
            UCBiddingSupplierList1.UpdateDepartMentSelect();

            //ErrMsg += this.BiddingSupplierGrade1.SubmitGradeData();
            return(ErrMsg);
        }
        catch (Exception ex)
        {
            ApplicationLog.WriteLog(this.ToString(), ex, "");
            Response.Write(Rms.Web.JavaScript.Alert(true, "保存出错:" + ex.Message));
            throw ex;
        }
    }