Exemple #1
0
        public DC_Message AddUpdateActivityDescription(MDMSVC.DC_Activity_Descriptions RQ)
        {
            object result = null;

            ServiceConnection.MDMSvcProxy.PostData(ConfigurationManager.AppSettings["addUpdate_Activity_Description"], RQ, typeof(MDMSVC.DC_Activity_Descriptions), typeof(DC_Message), out result);
            return((DC_Message)result);
        }
        protected void gvDescriptionSearch_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            Guid        myRow_Id = Guid.Parse(e.CommandArgument.ToString());
            GridViewRow row      = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
            int         index    = row.RowIndex;

            if (e.CommandName.ToString() == "Select")
            {
                dvMsg.Style.Add("display", "none");

                hdnDescId.Value     = myRow_Id.ToString();
                txtDescription.Text = Regex.Replace(System.Web.HttpUtility.HtmlDecode(gvDescriptionSearch.Rows[index].Cells[1].Text), "<.*?>", string.Empty);;

                ddlDescriptionType.ClearSelection();
                if (ddlDescriptionType.Items.FindByText(gvDescriptionSearch.Rows[index].Cells[0].Text) != null)
                {
                    ddlDescriptionType.Items.FindByText(gvDescriptionSearch.Rows[index].Cells[0].Text).Selected = true;
                }
            }
            else if (e.CommandName.ToString() == "SoftDelete")
            {
                TLGX_Consumer.MDMSVC.DC_Activity_Descriptions newObj = new MDMSVC.DC_Activity_Descriptions
                {
                    Activity_Description_Id = myRow_Id,
                    IsActive  = false,
                    Edit_Date = DateTime.Now,
                    Edit_User = System.Web.HttpContext.Current.User.Identity.Name
                };
                var result = AccSvc.AddUpdateActivityDescription(newObj);
                BootstrapAlert.BootstrapAlertMessage(dvMsg, result.StatusMessage, (BootstrapAlertType)result.StatusCode);
                BindActDescription(Convert.ToInt32(ddlShowEntries.SelectedItem.Text), 0);
            }

            else if (e.CommandName.ToString() == "UnDelete")
            {
                TLGX_Consumer.MDMSVC.DC_Activity_Descriptions newObj = new MDMSVC.DC_Activity_Descriptions
                {
                    Activity_Description_Id = myRow_Id,
                    IsActive  = true,
                    Edit_Date = DateTime.Now,
                    Edit_User = System.Web.HttpContext.Current.User.Identity.Name
                };
                var result = AccSvc.AddUpdateActivityDescription(newObj);
                BootstrapAlert.BootstrapAlertMessage(dvMsg, result.StatusMessage, (BootstrapAlertType)result.StatusCode);
                BindActDescription(Convert.ToInt32(ddlShowEntries.SelectedItem.Text), 0);
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Activity_Flavour_Id = new Guid(Request.QueryString["Activity_Flavour_Id"]);

            MDMSVC.DC_Activity_Descriptions RQ = new MDMSVC.DC_Activity_Descriptions
            {
                Activity_Description_Id = Guid.Parse(hdnDescId.Value),
                Activity_Flavour_Id     = Activity_Flavour_Id,
                DescriptionType         = ddlDescriptionType.SelectedItem.ToString(),
                Description             = txtDescription.Text.Trim(),
                Create_Date             = DateTime.Now,
                Create_User             = System.Web.HttpContext.Current.User.Identity.Name,
                IsActive = true
            };
            var res = AccSvc.AddUpdateActivityDescription(RQ);

            BootstrapAlert.BootstrapAlertMessage(dvMsg, res.StatusMessage, (BootstrapAlertType)res.StatusCode);
            BindActDescription(Convert.ToInt32(ddlShowEntries.SelectedItem.Text), 0);
        }