コード例 #1
0
 private void Save()
 {
     if (CallStatusControlValidation())
     {
         Business.Sales.MeetingType Obj   = new Business.Sales.MeetingType();
         Entity.Sales.MeetingType   Model = new Entity.Sales.MeetingType
         {
             Id          = MeetingTypeId,
             Name        = txtName.Text,
             Description = txtDescription.Text,
         };
         int rows = Obj.SaveMeetingType(Model);
         if (rows > 0)
         {
             ClearControls();
             LoadMeetingTypeList();
             MeetingTypeId     = 0;
             Message.IsSuccess = true;
             Message.Text      = "Saved Successfully";
         }
         else
         {
             Message.IsSuccess = false;
             Message.Text      = "Unable to save data.";
         }
         Message.Show = true;
     }
 }
コード例 #2
0
 private void GetMeetingTypeById()
 {
     Business.Sales.MeetingType Obj         = new Business.Sales.MeetingType();
     Entity.Sales.MeetingType   meetingType = Obj.GetMeetingTypeById(MeetingTypeId);
     if (meetingType.Id != 0)
     {
         txtDescription.Text = meetingType.Description;
         txtName.Text        = meetingType.Name;
     }
 }
コード例 #3
0
        protected void gvMeetingType_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                if (e.CommandName == "Ed")
                {
                    MeetingTypeId = Convert.ToInt32(e.CommandArgument.ToString());
                    GetMeetingTypeById();
                    Message.Show = false;
                    btnSave.Text = "Update";
                }
                else if (e.CommandName == "Del")
                {
                    Business.Sales.MeetingType Obj = new Business.Sales.MeetingType();
                    int rows = Obj.DeleteMeetingType(Convert.ToInt32(e.CommandArgument.ToString()));
                    if (rows > 0)
                    {
                        ClearControls();
                        LoadMeetingTypeList();
                        Message.IsSuccess = true;
                        Message.Text      = "Deleted Successfully";
                    }
                    else
                    {
                        Message.IsSuccess = false;
                        Message.Text      = "Data Dependency Exists";
                    }
                    Message.Show = true;
                }
            }
            catch (Exception ex)
            {
                ex.WriteException();

                Message.IsSuccess = false;
                Message.Text      = ex.Message;
                Message.Show      = true;
            }
        }
コード例 #4
0
 private void LoadMeetingTypeList()
 {
     Business.Sales.MeetingType Obj = new Business.Sales.MeetingType();
     gvMeetingType.DataSource = Obj.GetAllMeetingType();
     gvMeetingType.DataBind();
 }