예제 #1
0
        public DC_Message AddStaticDataMappingAttribute(MDMSVC.DC_SupplierImportAttributes RQ)
        {
            object result = null;

            ServiceConnection.MDMSvcProxy.PostData(ConfigurationManager.AppSettings["UploadStaticData_Add"], RQ, typeof(MDMSVC.DC_SupplierImportAttributes), typeof(DC_Message), out result);
            return(result as DC_Message);
        }
예제 #2
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            MDMSVC.DC_SupplierImportAttributes newObj = new MDMSVC.DC_SupplierImportAttributes
            {
                SupplierImportAttribute_Id = Guid.NewGuid(),
                Supplier_Id = ddlAddFor.SelectedItem.Text.Trim().ToUpper() == "MATCHING" ? Guid.Empty : Guid.Parse(ddlAddSupplier.SelectedItem.Value),
                Entity      = ddlAddEntity.SelectedItem.Text,
                Status      = "ACTIVE",
                CREATE_DATE = DateTime.Now,
                CREATE_USER = System.Web.HttpContext.Current.User.Identity.Name,
                For         = ddlAddFor.SelectedItem.Text
            };

            MDMSVC.DC_Message dc = new MDMSVC.DC_Message();
            dc = mappingsvc.AddStaticDataMappingAttribute(newObj);
            if (!(dc.StatusCode == MDMSVC.ReadOnlyMessageStatusCode.Success))
            {
                dvModalMsg.Visible = true;
                BootstrapAlert.BootstrapAlertMessage(dvModalMsg, dc.StatusMessage, BootstrapAlertType.Duplicate);
                resetModalControls();
                hdnFlag.Value = "false";
            }
            else
            {
                //Added code to fill filter and show added data.
                ddlSupplierName.SelectedIndex = ddlAddSupplier.Items.IndexOf(ddlSupplierName.Items.FindByValue(Convert.ToString(newObj.Supplier_Id)));
                ddlFor.SelectedIndex          = ddlAddFor.Items.IndexOf(ddlAddFor.Items.FindByText(Convert.ToString(newObj.For)));
                ddlEntity.SelectedIndex       = ddlAddEntity.Items.IndexOf(ddlAddEntity.Items.FindByText(Convert.ToString(newObj.Entity)));
                fillconfigdata(0, Convert.ToInt32(ddlShowEntries.SelectedItem.Text));
                dvModalMsg.Visible = false;
                dvMsg.Visible      = true;
                BootstrapAlert.BootstrapAlertMessage(dvMsg, dc.StatusMessage, BootstrapAlertType.Success);
                resetModalControls();
                hdnFlag.Value = "true";
            }
        }
예제 #3
0
        protected void grdMappingConfig_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                GridViewRow row      = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
                int         index    = row.RowIndex;
                Guid        myRow_Id = Guid.Parse(grdMappingConfig.DataKeys[index].Values[0].ToString());

                if (e.CommandName.ToString() == "SoftDelete")
                {
                    List <MDMSVC.DC_SupplierImportAttributes> RQ = new List <MDMSVC.DC_SupplierImportAttributes>();

                    MDMSVC.DC_SupplierImportAttributes newObj = new MDMSVC.DC_SupplierImportAttributes
                    {
                        SupplierImportAttribute_Id = myRow_Id,
                        For       = grdMappingConfig.Rows[index].Cells[0].Text,
                        Entity    = grdMappingConfig.Rows[index].Cells[2].Text,
                        Status    = "INACTIVE",
                        EDIT_DATE = DateTime.Now,
                        EDIT_USER = System.Web.HttpContext.Current.User.Identity.Name
                    };
                    if (grdMappingConfig.DataKeys[index].Values[1] != null)
                    {
                        newObj.Supplier_Id = Guid.Parse(grdMappingConfig.DataKeys[index].Values[1].ToString());
                    }
                    RQ.Add(newObj);
                    MDMSVC.DC_Message dc = new MDMSVC.DC_Message();
                    dc = mappingsvc.UpdateStaticDataMappingAttribute(RQ);
                    if (!(dc.StatusCode == MDMSVC.ReadOnlyMessageStatusCode.Success))
                    {
                        dvMsg.Style.Add("display", "block");
                        dvMsg.Visible = true;
                        BootstrapAlert.BootstrapAlertMessage(dvMsg, dc.StatusMessage, BootstrapAlertType.Duplicate);
                        fillconfigdata(0, Convert.ToInt32(ddlShowEntries.SelectedItem.Text));
                    }
                    else
                    {
                        dvMsg.Style.Add("display", "block");
                        dvMsg.Visible = true;
                        BootstrapAlert.BootstrapAlertMessage(dvMsg, "Record has been deleted Successfully", BootstrapAlertType.Success);
                        fillconfigdata(0, Convert.ToInt32(ddlShowEntries.SelectedItem.Text));
                    }
                }
                else if (e.CommandName.ToString() == "UnDelete")
                {
                    List <MDMSVC.DC_SupplierImportAttributes> RQ = new List <MDMSVC.DC_SupplierImportAttributes>();

                    MDMSVC.DC_SupplierImportAttributes newObj = new MDMSVC.DC_SupplierImportAttributes
                    {
                        SupplierImportAttribute_Id = myRow_Id,
                        For       = grdMappingConfig.Rows[index].Cells[0].Text,
                        Entity    = grdMappingConfig.Rows[index].Cells[2].Text,
                        Status    = "ACTIVE",
                        EDIT_DATE = DateTime.Now,
                        EDIT_USER = System.Web.HttpContext.Current.User.Identity.Name
                    };
                    if (grdMappingConfig.DataKeys[index].Values[1] != null)
                    {
                        newObj.Supplier_Id = Guid.Parse(grdMappingConfig.DataKeys[index].Values[1].ToString());
                    }
                    RQ.Add(newObj);
                    MDMSVC.DC_Message dc = new MDMSVC.DC_Message();
                    dc = mappingsvc.UpdateStaticDataMappingAttribute(RQ);
                    if (!(dc.StatusCode == MDMSVC.ReadOnlyMessageStatusCode.Success))
                    {
                        dvMsg.Visible = true;
                        BootstrapAlert.BootstrapAlertMessage(dvMsg, dc.StatusMessage, BootstrapAlertType.Duplicate);
                        fillconfigdata(0, Convert.ToInt32(ddlShowEntries.SelectedItem.Text));
                    }
                    else
                    {
                        dvMsg.Visible = true;
                        BootstrapAlert.BootstrapAlertMessage(dvMsg, "Record has been un deleted Successfully", BootstrapAlertType.Success);
                        fillconfigdata(0, Convert.ToInt32(ddlShowEntries.SelectedItem.Text));
                    }
                }
                else if (e.CommandName == "Select")
                {
                    Guid myRowId = Guid.Parse(e.CommandArgument.ToString());
                    //create Query String
                    string strQueryString = GetQueryString(myRowId.ToString(), ((GridView)sender).PageIndex.ToString());
                    Response.Redirect(strQueryString, false);
                    //end Query string
                }
            }
            catch { }
        }