Esempio n. 1
0
        private Entities.QS_RulesRange LoadSingleQS_RulesRange(DataRow row)
        {
            Entities.QS_RulesRange model = new Entities.QS_RulesRange();

            if (row["RecID"].ToString() != "")
            {
                model.RecID = int.Parse(row["RecID"].ToString());
            }
            if (row["QS_RTID"].ToString() != "")
            {
                model.QS_RTID = int.Parse(row["QS_RTID"].ToString());
            }
            if (row["QS_IM_RTID"].ToString() != "")
            {
                model.QS_IM_RTID = int.Parse(row["QS_IM_RTID"].ToString());
            }
            if (row["BGID"].ToString() != "")
            {
                model.BGID = int.Parse(row["BGID"].ToString());
            }
            if (row["Status"].ToString() != "")
            {
                model.Status = int.Parse(row["Status"].ToString());
            }
            if (row["CreateTime"].ToString() != "")
            {
                model.CreateTime = DateTime.Parse(row["CreateTime"].ToString());
            }
            if (row["CreateUserID"].ToString() != "")
            {
                model.CreateUserID = int.Parse(row["CreateUserID"].ToString());
            }
            return(model);
        }
Esempio n. 2
0
        public Entities.QS_RulesRange getModelByBGID(int BGID)
        {
            Entities.QS_RulesRange model = null;
            string  sqlStr = "select * from QS_RulesRange where BGID=" + BGID;
            DataSet ds     = new DataSet();

            ds = SqlHelper.ExecuteDataset(CONNECTIONSTRINGS, CommandType.Text, sqlStr);
            if (ds != null && ds.Tables.Count > 0)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    model = LoadSingleQS_RulesRange(ds.Tables[0].Rows[0]);
                }
            }
            return(model);
        }
Esempio n. 3
0
        /// 编辑应用范围
        /// <summary>
        /// 编辑应用范围
        /// </summary>
        /// <param name="msg"></param>
        private void RangeManage(out string msg)
        {
            msg = string.Empty;
            try
            {
                int bgid       = CommonFunction.ObjectToInteger(BGID, -1);
                int qs_rtid    = CommonFunction.ObjectToInteger(QS_RTID, -1);
                int qs_im_rtid = CommonFunction.ObjectToInteger(QS_IM_RTID, -1);

                Entities.QS_RulesRange old_Model = BLL.QS_RulesRange.Instance.getModelByBGID(bgid);

                BLL.QS_RulesRange.Instance.RangeManage(bgid, qs_rtid, qs_im_rtid);

                Entities.QS_RulesRange new_Model = BLL.QS_RulesRange.Instance.getModelByBGID(bgid);

                insertLog(old_Model, new_Model);

                msg = "{result:'ok',msg:''}";
            }
            catch (Exception ex)
            {
                msg = "{result:'error',msg:'" + ex.Message + "'}";
            }
        }