예제 #1
0
        public bool UpdateActivityClassifiationAttributes(MDMSVC.DC_Activity_ClassificationAttributes AF)
        {
            object result = null;

            ServiceConnection.MDMSvcProxy.PostData(ConfigurationManager.AppSettings["Update_Activity_ClasificationAttributes"], AF, typeof(DC_Activity_ClassificationAttributes), typeof(bool), out result);
            return((bool)result);
        }
예제 #2
0
        protected void grdClassificationAttributes_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //int index = Convert.ToInt32(e.CommandArgument);

            Guid myRow_Id = Guid.Parse(e.CommandArgument.ToString());

            if (e.CommandName.ToString() == "Select")
            {
                dvMsg.Style.Add("display", "none");
                MDMSVC.DC_Activity_ClassificationAttributes_RQ RQ = new DC_Activity_ClassificationAttributes_RQ();
                RQ.Activity_Flavour_Id = Guid.Parse(Request.QueryString["Activity_Flavour_Id"]);
                RQ.Activity_ClassificationAttribute_Id = myRow_Id;
                var res = AccSvc.GetActivityClasificationAttributes(RQ);

                frmClassificationAttribute.ChangeMode(FormViewMode.Edit);
                frmClassificationAttribute.DataSource = res;
                frmClassificationAttribute.DataBind();

                MDMSVC.DC_Activity_ClassificationAttributes rowView = (MDMSVC.DC_Activity_ClassificationAttributes)frmClassificationAttribute.DataItem;

                GetLookUpValues("Form", rowView.AttributeType.ToString());

                DropDownList ddlAttributeSubType = (DropDownList)frmClassificationAttribute.FindControl("ddlAttributeSubType");
                DropDownList ddlAttributeType    = (DropDownList)frmClassificationAttribute.FindControl("ddlAttributeType");

                if (ddlAttributeSubType.Items.Count > 1) // needs to be 1 to handle the "Select" value
                {
                    ddlAttributeSubType.SelectedIndex = ddlAttributeSubType.Items.IndexOf(ddlAttributeSubType.Items.FindByText(rowView.AttributeSubType.ToString()));
                }

                if (ddlAttributeType.Items.Count > 1) // needs to be 1 to handle the "Select" value
                {
                    ddlAttributeType.SelectedIndex = ddlAttributeType.Items.IndexOf(ddlAttributeType.Items.FindByText(rowView.AttributeType.ToString()));
                }
            }

            else if (e.CommandName.ToString() == "SoftDelete")
            {
                TLGX_Consumer.MDMSVC.DC_Activity_ClassificationAttributes newObj = new MDMSVC.DC_Activity_ClassificationAttributes
                {
                    Activity_ClassificationAttribute_Id = myRow_Id,
                    IsActive = false,
                    EditDate = DateTime.Now,
                    EditUser = System.Web.HttpContext.Current.User.Identity.Name
                };

                if (AccSvc.UpdateActivityClassifiationAttributes(newObj))
                {
                    GetClassificationAttributeDetails();
                    BootstrapAlert.BootstrapAlertMessage(dvMsg, "Attribute has been deleted successfully", BootstrapAlertType.Success);
                }
                ;
            }

            else if (e.CommandName.ToString() == "UnDelete")
            {
                TLGX_Consumer.MDMSVC.DC_Activity_ClassificationAttributes newObj = new MDMSVC.DC_Activity_ClassificationAttributes
                {
                    Activity_ClassificationAttribute_Id = myRow_Id,
                    IsActive = true,
                    EditDate = DateTime.Now,
                    EditUser = System.Web.HttpContext.Current.User.Identity.Name
                };

                if (AccSvc.UpdateActivityClassifiationAttributes(newObj))
                {
                    GetClassificationAttributeDetails();
                    BootstrapAlert.BootstrapAlertMessage(dvMsg, "Attribute has been retrived successfully", BootstrapAlertType.Success);
                }
                ;
            }
        }
예제 #3
0
        protected void frmClassificationAttribute_ItemCommand(object sender, FormViewCommandEventArgs e)
        {
            DropDownList ddlAttributeSubType = (DropDownList)frmClassificationAttribute.FindControl("ddlAttributeSubType");
            DropDownList ddlAttributeType    = (DropDownList)frmClassificationAttribute.FindControl("ddlAttributeType");
            TextBox      txtAttributeValue   = (TextBox)frmClassificationAttribute.FindControl("txtAttributeValue");
            CheckBox     chkInternalOnly     = (CheckBox)frmClassificationAttribute.FindControl("chkInternalOnly");


            if (e.CommandName.ToString() == "Add")
            {
                TLGX_Consumer.MDMSVC.DC_Activity_ClassificationAttributes newObj = new MDMSVC.DC_Activity_ClassificationAttributes
                {
                    Activity_ClassificationAttribute_Id = Guid.NewGuid(),
                    Activity_Flavour_Id = Guid.Parse(Request.QueryString["Activity_Flavour_Id"]),

                    //ActivityId
                    CreateDate       = DateTime.Now,
                    CreateUser       = System.Web.HttpContext.Current.User.Identity.Name,
                    IsActive         = true,
                    AttributeType    = ddlAttributeType.SelectedItem.ToString(),
                    AttributeSubType = ddlAttributeSubType.SelectedItem.ToString(),
                    AttributeValue   = txtAttributeValue.Text.Trim(),
                    InternalOnly     = chkInternalOnly.Checked
                };

                if (AccSvc.AddActivityClassifiationAttributes(newObj))
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "javascript:closeClassificationAttributesModal();", true);
                    GetClassificationAttributeDetails();
                    frmClassificationAttribute.DataBind();
                    frmClassificationAttribute.ChangeMode(FormViewMode.Insert);
                    GetLookUpValues("Page", "");
                    BootstrapAlert.BootstrapAlertMessage(dvMsg, "Attribute has been added successfully", BootstrapAlertType.Success);
                }
                else
                {
                    BootstrapAlert.BootstrapAlertMessage(dvMsg, "Error Occurred", BootstrapAlertType.Warning);
                }
                hdnFlag.Value = "true";
            }


            if (e.CommandName.ToString() == "Modify")
            {
                Activity_Flavour_Id = new Guid(Request.QueryString["Activity_Flavour_Id"]);
                Guid myRow_Id = Guid.Parse(frmClassificationAttribute.DataKey.Value.ToString());

                TLGX_Consumer.MDMSVC.DC_Activity_ClassificationAttributes newObj = new MDMSVC.DC_Activity_ClassificationAttributes
                {
                    Activity_ClassificationAttribute_Id = myRow_Id,
                    Activity_Flavour_Id = Activity_Flavour_Id,
                    EditDate            = DateTime.Now,
                    EditUser            = System.Web.HttpContext.Current.User.Identity.Name,
                    IsActive            = true,
                    AttributeType       = ddlAttributeType.SelectedItem.ToString(),
                    AttributeSubType    = ddlAttributeSubType.SelectedItem.ToString(),
                    AttributeValue      = txtAttributeValue.Text.Trim(),
                    InternalOnly        = chkInternalOnly.Checked
                };

                if (AccSvc.UpdateActivityClassifiationAttributes(newObj))
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop2", "javascript:closeClassificationAttributesModal();", true);

                    Activity_Flavour_Id = new Guid(Request.QueryString["Activity_Flavour_Id"]);

                    frmClassificationAttribute.ChangeMode(FormViewMode.Insert);
                    GetClassificationAttributeDetails();
                    frmClassificationAttribute.DataBind();
                    GetLookUpValues("Page", "");
                    BootstrapAlert.BootstrapAlertMessage(dvMsg, "Attribute has been updated successfully", BootstrapAlertType.Success);
                }
                else
                {
                    BootstrapAlert.BootstrapAlertMessage(dvMsg, "Error Occurred", BootstrapAlertType.Warning);
                }

                hdnFlag.Value = "true";
            }
            ;
        }