示例#1
0
 ///<summary>
 /// Returns a String that represents the current object.
 ///</summary>
 public override string ToString()
 {
     return("OrgPositionGroupTypeID:" + GroupTypeID.ToString());
 }
        protected void OnSave(object sender, EventArgs e)
        {
            var currentEntity = new GroupInfoEntity();

            currentEntity.GroupID     = _Id;
            currentEntity.GroupTypeID = this.GroupTypeID;
            currentEntity.OrderType   = 0;
            currentEntity.OrderNo     = 0;
            currentEntity.GroupName   = txtGroupName.Text;
            currentEntity.GroupDesc   = txtGroupDesc.Text;
            currentEntity.GroupTips   = "";
            currentEntity.GroupPicUrl = ThumbPicUrl.Value;
            currentEntity.Remarks     = "";
            currentEntity.StartTime   = this.txtStartTime.Text.Trim().Convert <DateTime>(DateTime.Now);
            currentEntity.EndTime     = this.txtEndTime.Text.Trim().Convert <DateTime>(new DateTime(2048, 1, 1));
            currentEntity.CreateTime  = DateTime.Now;
            currentEntity.UpdateTime  = DateTime.Now;
            currentEntity.Status      = 1; // 开启
            currentEntity.UpdateTime  = DateTime.Now;
            currentEntity.Remarks     = string.Empty;
            currentEntity.SchemeID    = this.SchemeID;

            bool result = false;

            if (_Id <= 0)
            {
                //新增
                currentEntity.CreateTime = DateTime.Now;
                int newId = new GroupBLL().InsertInfoForId(currentEntity);
                if (SchemeID == 104)
                {
                    OperateRecordEntity info = new OperateRecordEntity()
                    {
                        ElemId         = newId,
                        reason         = "",
                        Status         = 1,
                        OperateFlag    = "1",
                        SourcePage     = 61,
                        OperateType    = "5",
                        OperateExplain = "新增专题",
                        OperateContent = currentEntity.GroupName,
                        UserName       = GetUserName(),
                    };
                    new OperateRecordBLL().Insert(info);
                }
                this.Alert("新增成功", "SpecialTopicEdit.aspx?id=" + newId.ToString() + "&page=" + PageType + "&SchemeID=" + SchemeID.ToString() + "&GroupTypeID=" + GroupTypeID.ToString());
            }
            else
            {
                result = new GroupBLL().SpecialTopicUpdate(currentEntity);
                if (SchemeID == 104)
                {
                    OperateRecordEntity info = new OperateRecordEntity()
                    {
                        ElemId         = _Id,
                        reason         = "",
                        Status         = 1,
                        OperateFlag    = "2",
                        SourcePage     = 61,
                        OperateType    = "5",
                        OperateExplain = "编辑专题",
                        OperateContent = currentEntity.GroupName,
                        UserName       = GetUserName(),
                    };
                    new OperateRecordBLL().Insert(info);
                }
            }
            if (result)
            {
                this.Alert("保存成功");
                Bind();
            }
            else
            {
                this.Alert("保存失败!");
            }
        }