Example #1
0
        /// <summary>
        /// 加载平台信息
        /// </summary>
        private void LoadPlatform()
        {
            ChannelMO _mo = new ChannelMO();

            ChannelEO _eo = _mo.GetByPK(Request.QueryString["Chid"].ToString());

            if (!string.IsNullOrEmpty(_eo.CnName))
            {
                this.txtChannelName.Text    = _eo.CnName;
                this.txtChannelId.Text      = _eo.CnChannelId;
                this.txtDescription.Text    = _eo.CnDescription;
                this.rblState.SelectedValue = _eo.CnState;
            }
        }
Example #2
0
        /// <summary>
        /// 更新数据
        /// </summary>
        /// <param name = "item">要更新的实体对象</param>
        /// <param name="tm">事务管理对象</param>
        /// <return>受影响的行数</return>
        public virtual int PutById(ChannelEO item, TransactionManager tm = null)
        {
            const string sql = @"UPDATE channel SET Cn_channelId=@Cn_channelId, Cn_name=@Cn_name, Cn_description=@Cn_description, Ur_id=@Ur_id, Cn_addTime=@Cn_addTime, Cn_state=@Cn_state, Cn_Del=@Cn_Del, Cn_text1=@Cn_text1, Cn_text2=@Cn_text2 WHERE Cn_id=@Cn_id";

            return(Database.CreateSqlDao(sql)
                   .AddInParameter("@Cn_channelId", item.CnChannelId != null ? (object)item.CnChannelId : DBNull.Value, DbType.String, 50)
                   .AddInParameter("@Cn_name", item.CnName != null ? (object)item.CnName : DBNull.Value, DbType.String, 50)
                   .AddInParameter("@Cn_description", item.CnDescription != null ? (object)item.CnDescription : DBNull.Value, DbType.String, -1)
                   .AddInParameter("@Ur_id", item.UrId != null ? (object)item.UrId : DBNull.Value, DbType.String, 50)
                   .AddInParameter("@Cn_addTime", item.CnAddTime.HasValue ? (object)item.CnAddTime.Value : DBNull.Value, DbType.Date, 3)
                   .AddInParameter("@Cn_state", item.CnState != null ? (object)item.CnState : DBNull.Value, DbType.AnsiStringFixedLength, 1)
                   .AddInParameter("@Cn_Del", item.CnDel != null ? (object)item.CnDel : DBNull.Value, DbType.AnsiStringFixedLength, 1)
                   .AddInParameter("@Cn_text1", item.CnText1 != null ? (object)item.CnText1 : DBNull.Value, DbType.String, 200)
                   .AddInParameter("@Cn_text2", item.CnText2 != null ? (object)item.CnText2 : DBNull.Value, DbType.String, 200)
                   .AddInParameter("@Cn_id", item.CnId, DbType.String, 50)
                   .ExecNonQuery(tm));
        }
Example #3
0
        /// <summary>
        /// 新增、修改信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnOK_Click(object sender, EventArgs e)
        {
            if (this.CheckForm() == false)
            {
                CloseDivImplementation();
                return;
            }


            ChannelEO _eo = new ChannelEO();

            _eo.CnName        = txtChannelName.Text;
            _eo.CnChannelId   = txtChannelId.Text;
            _eo.CnDel         = "0";
            _eo.CnDescription = txtDescription.Text;
            _eo.CnState       = rblState.Text;
            _eo.UrId          = GetUserID();
            _eo.CnAddTime     = DateTime.Now;


            //创建平台信息
            if (Request.QueryString["State"] == "A")
            {
                //判断平台名称是否存在
                if (this.CheckChannelID() == false)
                {
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Channe_lID + this.txtChannelId.Text.Trim() + Resources.Resource.Already_exist;
                    CloseDivImplementation();
                    return;
                }
                _eo.CnId = GetBigGuid();

                if (_mo.Add(_eo) > 0)
                {
                    //插入操作日志
                    InsertLog(Resources.Resource.Create_channel_information, string.Format("Cn_name:{0},Cn_channelId:{1}", _eo.CnName, _eo.CnId), -6, GetPlatformIdByValue(1));
                    CloseDivImplementation();
                    Jswork.Alert(Resources.Resource.Channel_information_to_create_success, "ChannelList.aspx");
                }
                else
                {
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Create_channel_information_creation_failed;//"创建渠信息创建失败";
                }
            }

            //修改平台信息
            if (Request.QueryString["State"] == "U")
            {
                //判断平台名称是否存在
                if (this.CheckChannelID() == false)
                {
                    //Jswork.Alert("平台名称 " + this.txtPfname.Text.Trim() + " 已存在", this.Page);

                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Channe_lID + this.txtChannelId.Text.Trim() + Resources.Resource.Already_exist;
                    CloseDivImplementation();
                    return;
                }

                _eo.CnId = Request.QueryString["Chid"].ToString();
                if (_mo.PutById(_eo) > 0)
                {
                    //插入操作日志
                    InsertLog(Resources.Resource.Modify_channel_information, string.Format("CnId:{0},CnChannelId:{1}", _eo.CnId, _eo.CnChannelId), 5008, GetPlatformIdByValue(1));
                    CloseDivImplementation();
                    Jswork.Alert(Resources.Resource.Channel_information_to_modify_the_success_of, "ChannelList.aspx");
                }
                else
                {
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Channel_information_modification_failed; //"渠道信息修改失败";
                }
            }
            CloseDivImplementation();
        }