示例#1
0
        /// <summary>
        /// 编辑数据
        /// </summary>
        public void ModifyData()
        {
            try
            {
                BiddingSupplier cbiddingSupplier = new BiddingSupplier();
                cbiddingSupplier.dao = this.dao;
                cbiddingSupplier.BiddingPrejudicationCode = this.BiddingForwardPrejudicationCode;
                cbiddingSupplier.Flag = "1";
                EntityData entitydata = cbiddingSupplier._GetBiddingSuppliers();

                foreach (DataRow dr in entitydata.CurrentTable.Select())
                {
                    dr["flag"] = "0";
                }

                if (dao != null)
                {
                    dao.SubmitEntity(entitydata);
                }
                else
                {
                    using (dao = new StandardEntityDAO("BiddingSupplier"))
                    {
                        dao.SubmitEntity(entitydata);
                    }
                }


                int iCount = this.dgList.Items.Count;
                for (int i = 0; i < iCount; i++)
                {
                    string strCode  = this.dgList.Items[i].Cells[0].Text.Trim();
                    string strValue = ((HtmlInputText)this.dgList.Items[i].Cells[11].FindControl("txtNominateUser")).Value.Trim();

                    //if( ""==strValue )
                    //{
                    //    Response.Write( Rms.Web.JavaScript.Alert(true,"请填写提名人!") );
                    //    return;
                    //}

                    BLL.BiddingSupplier cbs = new RmsPM.BLL.BiddingSupplier();
                    cbs.dao = dao;
                    cbs.BiddingSupplierCode = strCode;
                    cbs.NominateUser        = strValue;
                    cbs.BiddingSupplierUpdate();
                }
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
            }
        }
示例#2
0
        /// <summary>
        /// 保存数据(状态修改)
        /// </summary>
        public void SaveData()
        {
            try
            {
                string[]  chkCodes = {};
                ArrayList chkAL    = new ArrayList();
                //string strchkSelect = "";
                for (int i = 0; i < dgList.Items.Count; i++)
                {
                    if (((HtmlInputCheckBox)dgList.Items[i].FindControl("chkSelect")).Checked)
                    {
                        chkAL.Add(dgList.Items[i].Cells[0].Text.Trim());
                    }
                }

                BLL.BiddingSupplier cbs = new RmsPM.BLL.BiddingSupplier();
                cbs.BiddingPrejudicationCode = this.BiddingPrejudicationCode;
                cbs.dao = dao;
                DataTable myDT    = cbs.GetBiddingSuppliers();
                int       dtCount = myDT.Rows.Count;
                for (int r = 0; r < dtCount; r++)
                {
                    string strCode = myDT.Rows[r]["BiddingSupplierCode"].ToString();

                    cbs.BiddingSupplierCode = strCode;
                    if (chkAL.Contains(strCode))
                    {
                        cbs.Flag = "1";
                    }
                    else
                    {
                        cbs.Flag = "0";
                    }

                    cbs.BiddingSupplierUpdate();
                }
                myDT.Dispose();
                UpdateDepartMentSelect();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
            }
        }