コード例 #1
0
        public List <DC_Activity_CategoryTypes_DDL> GetSupplierProductSubType(MDMSVC.DC_Supplier_DDL RQParams)
        {
            object result = null;

            ServiceConnection.MDMSvcProxy.PostData(ConfigurationManager.AppSettings["Activity_SupplierProductSubType_ForDDL"], RQParams, typeof(DC_Supplier_DDL), typeof(List <MDMSVC.DC_Activity_CategoryTypes_DDL>), out result);
            return(result as List <DC_Activity_CategoryTypes_DDL>);
        }
コード例 #2
0
        protected void frmEditCountryMap_ItemCommand(object sender, FormViewCommandEventArgs e)
        {
            Label        lblSupplierName       = (Label)frmEditCountryMap.FindControl("lblSupplierName");
            Label        lblSupplierCode       = (Label)frmEditCountryMap.FindControl("lblSupplierCode");
            Label        lblSupCountryName     = (Label)frmEditCountryMap.FindControl("lblSupCountryName");
            Label        lblSupCountryCode     = (Label)frmEditCountryMap.FindControl("lblSupCountryCode");
            DropDownList ddlSystemCountryName  = (DropDownList)frmEditCountryMap.FindControl("ddlSystemCountryName");
            TextBox      txtSystemCountryCode  = (TextBox)frmEditCountryMap.FindControl("txtSystemCountryCode");
            DropDownList ddlStatus             = (DropDownList)frmEditCountryMap.FindControl("ddlStatus");
            TextBox      txtSystemRemark       = (TextBox)frmEditCountryMap.FindControl("txtSystemRemark");
            TextBox      txtISO2CHAR           = (TextBox)frmEditCountryMap.FindControl("txtISO2CHAR");
            TextBox      txtISO3CHAR           = (TextBox)frmEditCountryMap.FindControl("txtISO3CHAR");
            Button       btnMatchedMapSelected = (Button)frmEditCountryMap.FindControl("btnMatchedMapSelected");
            Button       btnMatchedMapAll      = (Button)frmEditCountryMap.FindControl("btnMatchedMapAll");

            if (e.CommandName == "Add")
            {
                Guid?  countryid = null;
                string code      = string.Empty;
                string name      = string.Empty;
                Guid   myRow_Id  = Guid.Parse(grdCountryMaps.SelectedDataKey.Value.ToString());
                //SupplierMasters sData = new SupplierMasters();
                //sData = masters.GetSupplierDataByMapping_Id("country", myRow_Id);

                MDMSVC.DC_Supplier_DDL sData = new MDMSVC.DC_Supplier_DDL();
                sData = _objMasterSVC.GetSupplierDataByMapping_Id("COUNTRY", Convert.ToString(myRow_Id));

                if (!(ddlSystemCountryName.SelectedIndex == 0))
                {
                    countryid = new Guid(ddlSystemCountryName.SelectedItem.Value);
                    code      = masters.GetCodeById("country", new Guid(ddlSystemCountryName.SelectedItem.Value));
                    name      = ddlSystemCountryName.SelectedItem.Text;
                }

                MDMSVC.DC_CountryMapping newObj = new MDMSVC.DC_CountryMapping
                {
                    CountryMapping_Id = myRow_Id,
                    Country_Id        = countryid,
                    Supplier_Id       = sData.Supplier_Id,
                    SupplierName      = sData.Name,
                    Code      = code,
                    Status    = ddlStatus.SelectedItem.Text,
                    Name      = name,
                    Remarks   = txtSystemRemark.Text,
                    Edit_Date = DateTime.Now,
                    Edit_User = System.Web.HttpContext.Current.User.Identity.Name,
                };
                List <MDMSVC.DC_CountryMapping> RQUpCountry = new List <MDMSVC.DC_CountryMapping>();
                RQUpCountry.Add(newObj);
                if (mapperSVc.UpdateCountryMappingDatat(RQUpCountry))
                {
                    BootstrapAlert.BootstrapAlertMessage(dvMsg, "Record has been updated successfully", BootstrapAlertType.Success);
                    //frmEditCountryMap.Visible = false;
                    MatchedPageIndex    = 0;
                    MappedCountry_ID    = countryid;
                    MatchedSupplierName = lblSupCountryName.Text;
                    MatchedStatus       = ddlStatus.SelectedItem.Text;
                    //if (ddlStatus.SelectedItem.Text == "MAPPED")
                    if (!(ddlStatus.SelectedItem.Text == "DELETE"))
                    {
                        fillmatchingdata();
                        fillmappingdata();
                        dvMatchingRecords.Visible     = true;
                        btnMatchedMapSelected.Visible = true;
                        btnMatchedMapAll.Visible      = true;
                    }
                    else if (ddlStatus.SelectedItem.Text == "DELETE")
                    {
                        dvMsgForDelete.Visible = true;
                        BootstrapAlert.BootstrapAlertMessage(dvMsgForDelete, "Record has been updated successfully", BootstrapAlertType.Success);
                        dvMatchingRecords.Visible     = false;
                        btnMatchedMapSelected.Visible = false;
                        btnMatchedMapAll.Visible      = false;
                    }
                }
                hdnFlag.Value = "false";
            }
            else if (e.CommandName == "Cancel")
            {
                dvMsg.Style.Add("display", "none");
                frmEditCountryMap.ChangeMode(FormViewMode.Edit);
                frmEditCountryMap.DataSource = null;
                frmEditCountryMap.DataBind();
                frmEditCountryMap.Visible     = false;
                dvMatchingRecords.Visible     = false;
                btnMatchedMapSelected.Visible = false;
                btnMatchedMapAll.Visible      = false;
                fillmappingdata();
                hdnFlag.Value = "false";
            }
            else if (e.CommandName == "MapSelected")
            {
                List <MDMSVC.DC_CountryMapping> RQ = new List <MDMSVC.DC_CountryMapping>();

                Guid myRow_Id      = Guid.Empty;
                Guid mySupplier_Id = Guid.Empty;
                Guid?myCountry_Id  = Guid.Empty;
                foreach (GridViewRow row in grdMatchingCountry.Rows)
                {
                    //CheckBox chk = row.Cells[7].Controls[1] as CheckBox;
                    HtmlInputCheckBox chk = row.Cells[7].Controls[1] as HtmlInputCheckBox;

                    if (chk != null && chk.Checked)
                    {
                        myRow_Id      = Guid.Empty;
                        mySupplier_Id = Guid.Empty;
                        myCountry_Id  = Guid.Empty;
                        int index = row.RowIndex;
                        myRow_Id      = Guid.Parse(grdMatchingCountry.DataKeys[index].Values[0].ToString());
                        mySupplier_Id = Guid.Parse(grdMatchingCountry.DataKeys[index].Values[1].ToString());
                        myCountry_Id  = MappedCountry_ID;
                    }
                    if (myRow_Id != Guid.Empty)
                    {
                        MDMSVC.DC_CountryMapping param = new MDMSVC.DC_CountryMapping();
                        param.CountryMapping_Id = myRow_Id;
                        if (mySupplier_Id != null)
                        {
                            param.Supplier_Id = mySupplier_Id;
                        }
                        if (myCountry_Id != null)
                        {
                            param.Country_Id = myCountry_Id;
                        }
                        param.Status    = MatchedStatus;
                        param.Edit_Date = DateTime.Now;
                        param.Edit_User = System.Web.HttpContext.Current.User.Identity.Name;
                        RQ.Add(param);
                        //res = mapperSVc.UpdateCountryMappingDatat(RQ);
                        myRow_Id      = Guid.Empty;
                        mySupplier_Id = Guid.Empty;
                        myCountry_Id  = Guid.Empty;
                    }
                }
                if (mapperSVc.UpdateCountryMappingDatat(RQ))
                {
                    BootstrapAlert.BootstrapAlertMessage(dvMsg, "Matching Records are mapped successfully", BootstrapAlertType.Success);
                    fillmatchingdata();
                    fillmappingdata();
                    hdnFlag.Value = "false";
                }
            }
            else if (e.CommandName == "MapAll")
            {
                List <MDMSVC.DC_CountryMapping> RQ = new List <MDMSVC.DC_CountryMapping>();

                Guid myRow_Id      = Guid.Empty;
                Guid mySupplier_Id = Guid.Empty;
                Guid?myCountry_Id  = Guid.Empty;

                foreach (GridViewRow row in grdMatchingCountry.Rows)
                {
                    myRow_Id      = Guid.Empty;
                    mySupplier_Id = Guid.Empty;
                    myCountry_Id  = Guid.Empty;
                    int index = row.RowIndex;
                    myRow_Id      = Guid.Parse(grdMatchingCountry.DataKeys[index].Values[0].ToString());
                    mySupplier_Id = Guid.Parse(grdMatchingCountry.DataKeys[index].Values[1].ToString());
                    myCountry_Id  = MappedCountry_ID;
                    if (myRow_Id != Guid.Empty)
                    {
                        MDMSVC.DC_CountryMapping param = new MDMSVC.DC_CountryMapping();
                        param.CountryMapping_Id = myRow_Id;
                        if (mySupplier_Id != null)
                        {
                            param.Supplier_Id = mySupplier_Id;
                        }
                        if (myCountry_Id != null)
                        {
                            param.Country_Id = myCountry_Id;
                        }
                        param.Status    = MatchedStatus;
                        param.Edit_Date = DateTime.Now;
                        param.Edit_User = System.Web.HttpContext.Current.User.Identity.Name;
                        RQ.Add(param);
                        myRow_Id      = Guid.Empty;
                        mySupplier_Id = Guid.Empty;
                        myCountry_Id  = Guid.Empty;
                    }
                }
                if (mapperSVc.UpdateCountryMappingDatat(RQ))
                {
                    BootstrapAlert.BootstrapAlertMessage(dvMsg, "Matching Records are mapped successfully", BootstrapAlertType.Success);
                    fillmatchingdata();
                    fillmappingdata();
                }
                hdnFlag.Value = "false";
            }
            ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop2" + DateTime.Today.Ticks.ToString(), "javascript:closeCountryMappingModal();", true);
        }
コード例 #3
0
        protected void grdCountryMaps_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                Guid        myRow_Id = Guid.Parse(e.CommandArgument.ToString());
                GridViewRow row      = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
                int         index    = row.RowIndex;
                if (e.CommandName == "Select")
                {
                    dvMsgForDelete.Visible        = false;
                    grdMatchingCountry.DataSource = null;
                    grdMatchingCountry.DataBind();
                    dvMatchingRecords.Visible = false;
                    List <MDMSVC.DC_CountryMapping> obj = new List <MDMSVC.DC_CountryMapping>();
                    obj.Add(new MDMSVC.DC_CountryMapping
                    {
                        CountryMapping_Id = myRow_Id,
                        //MapID = Convert.ToInt32(grdCountryMaps.Rows[index].Cells[0].Text),
                        SupplierName = grdCountryMaps.Rows[index].Cells[1].Text,
                        CountryCode  = grdCountryMaps.Rows[index].Cells[2].Text,
                        CountryName  = grdCountryMaps.Rows[index].Cells[3].Text,
                        Code         = grdCountryMaps.Rows[index].Cells[4].Text,
                        Name         = grdCountryMaps.Rows[index].Cells[5].Text,
                        Status       = grdCountryMaps.Rows[index].Cells[7].Text
                    });

                    //SupplierMasters sData = new SupplierMasters();
                    //sData = masters.GetSupplierDataByMapping_Id("country", myRow_Id);

                    MDMSVC.DC_Supplier_DDL sData = new MDMSVC.DC_Supplier_DDL();
                    sData = _objMasterSVC.GetSupplierDataByMapping_Id("COUNTRY", Convert.ToString(myRow_Id));
                    string supCode = sData.Code;
                    //string supCode = masters.GetSupplierCodeById(new Guid(grdCountryMaps.Rows[index].Cells[7].Text));

                    frmEditCountryMap.Visible = true;
                    frmEditCountryMap.ChangeMode(FormViewMode.Edit);
                    frmEditCountryMap.DataSource = obj;
                    frmEditCountryMap.DataBind();

                    Label        lblSupplierName      = (Label)frmEditCountryMap.FindControl("lblSupplierName");
                    Label        lblSupplierCode      = (Label)frmEditCountryMap.FindControl("lblSupplierCode");
                    Label        lblSupCountryName    = (Label)frmEditCountryMap.FindControl("lblSupCountryName");
                    Label        lblSupCountryCode    = (Label)frmEditCountryMap.FindControl("lblSupCountryCode");
                    DropDownList ddlSystemCountryName = (DropDownList)frmEditCountryMap.FindControl("ddlSystemCountryName");
                    TextBox      txtSystemCountryCode = (TextBox)frmEditCountryMap.FindControl("txtSystemCountryCode");
                    DropDownList ddlStatus            = (DropDownList)frmEditCountryMap.FindControl("ddlStatus");
                    TextBox      txtSystemRemark      = (TextBox)frmEditCountryMap.FindControl("txtSystemRemark");
                    TextBox      txtISO2CHAR          = (TextBox)frmEditCountryMap.FindControl("txtISO2CHAR");
                    TextBox      txtISO3CHAR          = (TextBox)frmEditCountryMap.FindControl("txtISO3CHAR");
                    fillcountries(ddlSystemCountryName, "");
                    fillmappingstatus(ddlStatus);
                    lblSupplierName.Text   = System.Web.HttpUtility.HtmlDecode(grdCountryMaps.Rows[index].Cells[1].Text);
                    lblSupplierCode.Text   = "(" + supCode + ")";
                    lblSupCountryName.Text = System.Web.HttpUtility.HtmlDecode(grdCountryMaps.Rows[index].Cells[3].Text);
                    lblSupCountryCode.Text = System.Web.HttpUtility.HtmlDecode(grdCountryMaps.Rows[index].Cells[2].Text);
                    //txtSystemCountryCode.Text = System.Web.HttpUtility.HtmlDecode(grdCountryMaps.Rows[index].Cells[4].Text);
                    txtSystemRemark.Text = masters.GetRemarksForMapping("country", myRow_Id);
                    if (grdCountryMaps.Rows[index].Cells[7].Text.ToString() == "REVIEW" || grdCountryMaps.Rows[index].Cells[7].Text.ToString() == "MAPPED")
                    {
                        ddlSystemCountryName.SelectedIndex = ddlSystemCountryName.Items.IndexOf(ddlSystemCountryName.Items.FindByText(System.Web.HttpUtility.HtmlDecode(grdCountryMaps.Rows[index].Cells[5].Text)));
                        ddlStatus.SelectedIndex            = ddlStatus.Items.IndexOf(ddlStatus.Items.FindByText(System.Web.HttpUtility.HtmlDecode(grdCountryMaps.Rows[index].Cells[7].Text)));

                        var result = _objMasterSVC.GetCountryCodes(ddlSystemCountryName.SelectedValue);
                        if (result != null && result.Count > 0)
                        {
                            txtSystemCountryCode.Text = result[0].Code;
                            txtISO2CHAR.Text          = result[0].ISO3166_1_Alpha_2;
                            txtISO3CHAR.Text          = result[0].ISO3166_1_Alpha_3;
                        }
                    }
                    hdnFlag.Value = "false";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "javascript:showCountryMappingModal();", true);
                    //Page.ClientScript.RegisterStartupScript(Page.GetType(), "Pop1", "javascript:showCountryMappingModal();", false);
                }
            }
            catch
            {
            }
        }