Exemple #1
0
        private void CreateMap(DropDownList ddlWerp, TextBox txtExternalCode, TextBox txtNewEXtName)
        {
            try
            {
                bool result;
                werplookupCodeValueManagementVo              = new WERPlookupCodeValueManagementVo();
                werplookupCodeValueManagementVo.SourceCode   = ddlRTA.SelectedValue;
                werplookupCodeValueManagementVo.LookupID     = Convert.ToInt32(ddlWerp.SelectedValue);
                werplookupCodeValueManagementVo.ExternalCode = txtExternalCode.Text;
                werplookupCodeValueManagementVo.ExternalName = txtNewEXtName.Text;

                result = onlineOrderBackOfficeBo.CreateMapwithRTA(werplookupCodeValueManagementVo, userVo.UserId);
                if (result)
                {
                    BindMapingGrid(ddlRTA.SelectedValue, Convert.ToInt32(ddlCategory.SelectedValue));
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Maping Created Successfully.');", true);
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Maping Already Exist.');", true);
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "ManageLookups.ascx.cs:CreateMap()");
                object[] objects = new object[3];
                objects[1]   = ddlWerp;
                objects[2]   = txtExternalCode;
                objects[3]   = txtNewEXtName;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Exemple #2
0
        private void UpdateWerpName(int lookupID, string werpName)
        {
            try
            {
                bool result;
                werplookupCodeValueManagementVo          = new WERPlookupCodeValueManagementVo();
                werplookupCodeValueManagementVo.LookupID = lookupID;
                werplookupCodeValueManagementVo.WerpName = werpName;

                result = onlineOrderBackOfficeBo.UpdateWerpName(werplookupCodeValueManagementVo, userVo.UserId);
                if (result)
                {
                    BindWerpGrid(Convert.ToInt32(ddlCategory.SelectedValue));
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Internal Name Updated Successfully.');", true);
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Error in Updating');", true);
                }
            }

            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "ManageLookups.ascx.cs:UpdateWerpName()");
                object[] objects = new object[1];
                objects[1]   = lookupID;
                objects[2]   = werpName;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Exemple #3
0
        private void RemoveMaping()
        {
            try
            {
                int  i = 0;
                bool result;
                int  mapingID;
                foreach (GridDataItem gvRow in rgMaping.Items)
                {
                    CheckBox chk = (CheckBox)gvRow.FindControl("cbMap");
                    if (chk.Checked)
                    {
                        count++;
                    }
                    if (count > 1)
                    {
                        chk.Checked = false;
                    }
                }
                if (count == 0)
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Please select a record!');", true);
                }
                if (count == 1)
                {
                    foreach (GridDataItem gdi in rgMaping.Items)
                    {
                        if (((CheckBox)gdi.FindControl("cbMap")).Checked == true)
                        {
                            int selectedRow = gdi.ItemIndex + 1;
                            mapingID = int.Parse(rgMaping.MasterTableView.DataKeyValues[selectedRow - 1]["WCMVXM_Id"].ToString());

                            werplookupCodeValueManagementVo       = new WERPlookupCodeValueManagementVo();
                            werplookupCodeValueManagementVo.MapID = mapingID;

                            result = onlineOrderBackOfficeBo.RemoveMapingWIthRTA(werplookupCodeValueManagementVo);
                            if (result)
                            {
                                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Maping Removed Successfully.');", true);
                            }
                        }
                    }
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('You can select only one record at a time.');", true);
                }
                BindMapingGrid(ddlRTA.SelectedValue, Int32.Parse(ddlCategory.SelectedValue));
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "ManageLookups.ascx.cs:RemoveMaping()");
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }