Exemplo n.º 1
0
        /// <summary>
        /// 通过formid更新IsApproval字段
        /// </summary>
        /// <param name="model"></param>
        public static JC_BidScalingInfo UpdateJC_BidScalingInfoInfoByModel(JC_BidScalingInfo model)
        {
            SqlParameter[] parameters = new SqlParameter[] {
                new SqlParameter("@FormID", System.Data.SqlDbType.NVarChar, 100),
                new SqlParameter("@IsApproval", System.Data.SqlDbType.NVarChar, 100),
            };
            parameters[0].Value = model.FormID;
            parameters[1].Value = model.IsApproval;

            DataTable dataTable = DBHelper.ExecutedProcedure("Biz.JC_BidScalingInfoByID_Update", parameters);

            return(model);
        }
Exemplo n.º 2
0
        public JC_BidScalingInfo GetBidScalingInfo(string formId)
        {
            SqlParameter[] parameters = new SqlParameter[] {
                new SqlParameter("@FormID", System.Data.SqlDbType.NVarChar, 100),
            };
            parameters[0].Value = formId;
            JC_BidScalingInfo model     = new JC_BidScalingInfo();
            DataTable         datatable = DBHelper.ExecutedProcedure("Biz.JC_GetBidScaling", parameters);

            if (datatable != null && datatable.Rows.Count > 0)
            {
                return(DataRowToModel(datatable.Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool UpdateBidScaling(JC_BidScalingInfo model)
        {
            string methodName = "UpdateBidScaling";

            Logger.Write(this.GetType(), EnumLogLevel.Info, className + ":" + methodName + ":" + MessageType.IN + ":" + string.Format("JC_BidScalingInfo={0}", model));
            DataProvider db = new DataProvider();

            db.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["BPMConnectionString"].ConnectionString;
            string sql = string.Format("Update Biz.JC_BidScaling set StartDeptCode='{0}',Title = '{1}',DeptName = '{2}',UserName='******'," +
                                       "DateTime='{4}',Content='{5}',EntranceTime='{6}',IsAccreditByGroup='{7}',FirstLevel='{8}',FirstUnit='{9}',SecondUnit='{10}'," +
                                       "ScalingResult ='{11}',BidCommittee = '{12}',IsApproval = '{13}' where FormID = '{14}'",
                                       model.StartDeptCode, model.Title, model.DeptName, model.UserName, model.DateTime, model.Content, model.EntranceTime,
                                       model.IsAccreditByGroup, model.FirstLevel, model.FirstUnit, model.SecondUnit, model.ScalingResult, model.BidCommittee, model.IsApproval, model.FormID);

            if (db.ExecuteNonQuery(sql, CommandType.Text) > 0)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 4
0
        public JC_BidScalingInfo GetBidScaling(string FormID)
        {
            string methodName = "GetBidScaling";

            Logger.Write(this.GetType(), EnumLogLevel.Info, className + ":" + methodName + ":" + MessageType.IN + ":" + string.Format("ID={0}", FormID));
            DataProvider db = new DataProvider();

            db.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["BPMConnectionString"].ConnectionString;
            SqlParameter[] parameters = new SqlParameter[] {
                new SqlParameter("@FormID", System.Data.SqlDbType.NVarChar, 100)
            };
            parameters[0].Value = FormID;
            DataTable         dt     = db.ExecutedProcedure("Biz.JC_GetBidScaling", parameters);
            JC_BidScalingInfo jcInfo = new JC_BidScalingInfo();

            if (dt != null && dt.Rows.Count > 0)
            {
                jcInfo.FormID            = Assign(dt.Rows[0]["FormID"]);
                jcInfo.StartDeptCode     = Assign(dt.Rows[0]["StartDeptCode"]);
                jcInfo.Title             = Assign(dt.Rows[0]["Title"]);
                jcInfo.DeptName          = Assign(dt.Rows[0]["DeptName"]);
                jcInfo.UserName          = Assign(dt.Rows[0]["UserName"]);
                jcInfo.DateTime          = Assign(dt.Rows[0]["DateTime"]);
                jcInfo.Content           = Assign(dt.Rows[0]["Content"]);
                jcInfo.EntranceTime      = Assign(dt.Rows[0]["EntranceTime"]);
                jcInfo.IsAccreditByGroup = Assign(dt.Rows[0]["IsAccreditByGroup"]);
                jcInfo.FirstLevel        = Assign(dt.Rows[0]["FirstLevel"]);
                jcInfo.FirstUnit         = Assign(dt.Rows[0]["FirstUnit"]);
                jcInfo.SecondUnit        = Assign(dt.Rows[0]["SecondUnit"]);
                jcInfo.ScalingResult     = Assign(dt.Rows[0]["ScalingResult"]);
                jcInfo.BidCommittee      = Assign(dt.Rows[0]["BidCommittee"]);
                jcInfo.IsApproval        = Assign(dt.Rows[0]["IsApproval"]);
                return(jcInfo);
            }

            return(null);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 封装实体
        /// </summary>
        /// <param name="dataRow"></param>
        /// <returns></returns>
        private static JC_BidScalingInfo DataRowToModel(DataRow dataRow)
        {
            JC_BidScalingInfo info = new JC_BidScalingInfo();

            if (dataRow != null)
            {
                if (dataRow["FormID"] != null)
                {
                    info.FormID = dataRow["FormID"].ToString();
                }
                if (dataRow["StartDeptCode"] != null)
                {
                    info.StartDeptCode = dataRow["StartDeptCode"].ToString();
                }
                if (dataRow["Title"] != null)
                {
                    info.Title = dataRow["Title"].ToString();
                }
                if (dataRow["DeptName"] != null)
                {
                    info.DeptName = dataRow["DeptName"].ToString();
                }
                if (dataRow["UserName"] != null)
                {
                    info.UserName = dataRow["UserName"].ToString();
                }
                if (dataRow["DateTime"] != null)
                {
                    info.DateTime = dataRow["DateTime"].ToString();
                }
                if (dataRow["Content"] != null)
                {
                    info.Content = dataRow["Content"].ToString();
                }
                if (dataRow["EntranceTime"] != null)
                {
                    info.EntranceTime = dataRow["EntranceTime"].ToString();
                }
                if (dataRow["IsAccreditByGroup"] != null)
                {
                    info.IsAccreditByGroup = dataRow["IsAccreditByGroup"].ToString();
                }
                if (dataRow["FirstLevel"] != null)
                {
                    info.FirstLevel = dataRow["FirstLevel"].ToString();
                }
                if (dataRow["FirstUnit"] != null)
                {
                    info.FirstUnit = dataRow["FirstUnit"].ToString();
                }
                if (dataRow["SecondUnit"] != null)
                {
                    info.SecondUnit = dataRow["SecondUnit"].ToString();
                }
                if (dataRow["ScalingResult"] != null)
                {
                    info.ScalingResult = dataRow["ScalingResult"].ToString();
                }
                if (dataRow["BidCommittee"] != null)
                {
                    info.BidCommittee = dataRow["BidCommittee"].ToString();
                }
                if (dataRow["IsApproval"] != null)
                {
                    info.IsApproval = dataRow["IsApproval"].ToString();
                }
            }
            return(info);
        }