コード例 #1
0
 public void SaveCorporate()
 {
     try
     {
         EventLogger log             = new EventLogger(config);
         bool        isvalidcorp     = false;
         bool        isvalidcorpdesc = false;
         ObjCorporate.CorporateName        = txtCorporateFullName.Text;
         ObjCorporate.CorporateDescription = txtCorporateDesc.Text;
         ObjCorporate.POEmail   = txtPOEmail.Text;
         ObjCorporate.CreatedBy = defaultPage.UserId;
         List <BindCorporateMaster> lstCor = lclsservice.BindCorporateMaster().Where(a => a.CorporateName == ObjCorporate.CorporateName).ToList();
         if (lstCor.Count > 0)
         {
             isvalidcorp = true;
         }
         else
         {
             List <BindCorporateMaster> lstCorpdesc = lclsservice.BindCorporateMaster().Where(a => a.CorporateDescription == ObjCorporate.CorporateDescription).ToList();
             if (lstCorpdesc.Count > 0)
             {
                 isvalidcorpdesc = true;
             }
         }
         if (isvalidcorp == false && isvalidcorpdesc == false)
         {
             save = lclsservice.InsertCorporateMaster(ObjCorporate);
             if (save == "Saved Successfully")
             {
                 string msg = Constant.CorporateSaveMessage.Replace("ShowPopup('", "").Replace("<<Corporate>>", "").Replace("');", "");
                 log.LogInformation(msg);
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.CorporateSaveMessage.Replace("<<Corporate>>", ""), true);
                 BindGrid();
                 clear();
             }
         }
         else
         {
             if (isvalidcorp == true)
             {
                 log.LogWarning(msgwrn.Replace("<<Corporate>>", txtCorporateFullName.Text));
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.WarningValidCorporateMessage.Replace("<<Corporate>>", txtCorporateFullName.Text), true);
             }
             else
             {
                 log.LogWarning(logmsg.Replace("<<Corporate>>", txtCorporateDesc.Text));
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.WarningValidCorporatecdescMessage.Replace("<<Corporate>>", txtCorporateDesc.Text), true);
             }
         }
     }
     catch (Exception ex)
     {
         EventLogger log = new EventLogger(config);
         log.LogException(ex);
         ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.CorporateErrorMessage.Replace("<<Corporate>>", ex.Message.ToString()), true);
     }
 }
コード例 #2
0
        //private void LoadLookups(string mode)
        //{
        //    BindVendor(mode);
        //    BindFacility(mode);
        //}
        private bool ValidateLoookups(InventoryServiceClient service)
        {
            bool   result     = true;
            string errmessage = "";
            //Facility Lookup
            List <GetFacility> lstfac = service.GetFacility().Where(a => a.IsActive == true && a.FacilityID == Convert.ToInt64(drdFacilityName.SelectedValue)).ToList();

            if (lstfac.Count == 0)
            {
                errmessage += "Facility (" + drdFacilityName.SelectedItem.Text + ") , ";
                result      = false;
            }

            //Vendor Lookup
            List <GetvendorDetails> lstvendor = service.GetvendorDetails("").Where(a => a.IsActive == true && a.VendorID == Convert.ToInt64(drdVendorName.SelectedValue)).ToList();

            if (lstvendor.Count == 0)
            {
                errmessage += "Vendor (" + drdVendorName.SelectedItem.Text + ") ";
                result      = false;
            }


            if (!result)
            {
                EventLogger log = new EventLogger(config);
                string      msg = Constant.WarningLookupMessage.Replace("ShowwarningLookupPopup('", "").Replace("<<values>>", errmessage).Replace("');", "");
                log.LogWarning(msg);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.WarningLookupMessage.Replace("<<values>>", errmessage), true);
            }

            return(result);
        }
コード例 #3
0
        private bool ValidateLoookups(InventoryServiceClient service)
        {
            bool   result     = true;
            string errmessage = "";
            //Item Category Lookup
            List <GetItemCategory> lstCat = service.GetItemCategory().Where(a => a.IsActive == true && a.CategoryID == Convert.ToInt64(drdItemCategory.SelectedValue)).ToList();

            if (lstCat.Count == 0)
            {
                errmessage += "ItemCategory (" + drdItemCategory.SelectedItem.Text + ") , ";
                result      = false;
            }

            //UOM Lookup
            List <GetUom> lstUOM = service.GetUom().Where(a => a.IsActivestr == "1" && a.UomID == Convert.ToInt64(ddlUOM.SelectedValue)).ToList();

            if (lstUOM.Count == 0)
            {
                errmessage += "UOM (" + ddlUOM.SelectedItem.Text + ") , ";
                result      = false;
            }

            if (!result)
            {
                LoadLookups("Add");
                EventLogger log = new EventLogger(config);
                string      msg = Constant.WarningLookupMessage.Replace("ShowwarningLookupPopup('", "").Replace("<<values>>", errmessage).Replace("');", "");
                log.LogWarning(msg);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.WarningLookupMessage.Replace("<<values>>", errmessage), true);
            }

            return(result);
        }
コード例 #4
0
        //private void LoadLookups(string mode)
        //{
        //    try
        //    {
        //        BindCategory(mode);
        //        BindItem(mode);
        //        BindVendor(mode);
        //    }
        //    catch (Exception ex)
        //    {
        //        ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorItemMapErrorMessage.Replace("<<VendorItemMap>>", ex.Message), true);
        //    }
        //}

        private bool ValidateLoookups(InventoryServiceClient service)
        {
            try
            {
                bool   result     = true;
                string errmessage = "";
                //Item Category Lookup
                List <GetItemCategory> lstCat = service.GetItemCategory().Where(a => a.IsActive == true && a.CategoryID == Convert.ToInt64(drdItemCategory.SelectedValue)).ToList();
                if (lstCat.Count == 0)
                {
                    errmessage += "ItemCategory (" + drdItemCategory.SelectedItem.Text + ") , ";
                    result      = false;
                }

                //Item based on Category Lookup
                List <GetDrpItemsByCategory> lstitemCat = service.GetDrpItemsByCategory(Convert.ToInt64(drdItemCategory.SelectedValue)).Where(a => a.IsActive == true && a.ItemID == Convert.ToInt64(drdItemID.SelectedValue)).ToList();
                if (lstitemCat.Count == 0)
                {
                    errmessage += "Item (" + drdItemID.SelectedItem.Text + ") , ";
                    result      = false;
                }

                //Vendor Lookup
                List <GetvendorDetails> lstvendor = service.GetvendorDetails("").Where(a => a.IsActive == true && a.VendorID == Convert.ToInt64(drdVendorID.SelectedValue)).ToList();
                if (lstvendor.Count == 0)
                {
                    errmessage += "Vendor (" + drdVendorID.SelectedItem.Text + ") ";
                    result      = false;
                }



                if (!result)
                {
                    EventLogger log = new EventLogger(config);
                    string      msg = Constant.WarningLookupMessage.Replace("ShowwarningLookupPopup('", "").Replace("<<values>>", errmessage).Replace("');", "");
                    log.LogWarning(msg);
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.WarningLookupMessage.Replace("<<values>>", errmessage), true);
                }

                return(result);
            }
            catch (Exception ex)
            {
                EventLogger log = new EventLogger(config);
                log.LogException(ex);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorItemMapErrorMessage.Replace("<<VendorItemMap>>", ex.Message), true);
                return(false);
            }
        }
コード例 #5
0
 protected void ImageRemoveYes_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         string Delete = lclsservice.DeleteCorporateDetails(Convert.ToInt64(HiddenCorporateMasterID.Value), false, defaultPage.UserId);
         if (Delete == "Deleted Successfully")
         {
             EventLogger log = new EventLogger(config);
             log.LogWarning(msgerr.Replace("<<Corporate>>", HiddenCorporateName.Value));
             ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.CorporateDeleteMessage.Replace("<<Corporate>>", HiddenCorporateName.Value), true);
             BindGrid();
         }
     }
     catch (Exception ex)
     {
         EventLogger log = new EventLogger(config);
         log.LogException(ex);
         ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.CorporateErrorMessage.Replace("<<Corporate>>", ex.Message.ToString()), true);
     }
 }
コード例 #6
0
        //protected void btndelete_Click(object sender, EventArgs e)
        //{
        //    RemoveRequiredFields();
        //    deletebtn.Style.Add("display", "none");
        //    savebtn.Style.Add("display", "block");
        //    div_ADDContent.Style.Add("display", "none");
        //    divCorporate.Style.Add("display","block");
        //    HdnStatus.Value = "Delete";
        //    foreach (GridViewRow gvrow in gvCorporate.Rows)
        //    {
        //        CheckBox chkactive = (CheckBox)gvrow.FindControl("chkactive");
        //        chkactive.Enabled = true;
        //    }
        //}



        protected void btndeleteimg_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                ImageButton btndelete = sender as ImageButton;
                GridViewRow row       = (GridViewRow)btndelete.NamingContainer;
                HiddenCorporateMasterID.Value = row.Cells[1].Text.Trim().Replace("&nbsp;", "");
                txtCorporateFullName.Text     = row.Cells[2].Text.Trim().Replace("&nbsp;", "");
                HiddenCorporateName.Value     = row.Cells[2].Text.Trim().Replace("&nbsp;", "");
                ObjCorporate.CorporateID      = Convert.ToInt64(HiddenCorporateMasterID.Value);
                ObjCorporate.LoggedinBy       = defaultPage.UserId;
                ObjCorporate.Filter           = "";
                List <chkvalidcorporate> lclscorp = lclsservice.chkvalidcorporate(ObjCorporate).ToList();
                if (lclscorp.Count <= 0)
                {
                    DeleteCorporate();
                }
                else
                {
                    //string corpfac = string.Empty;
                    //foreach (var lst in lclscorp)
                    //{
                    //    corpfac += lst.FacilityDescription+",";
                    //}
                    EventLogger log = new EventLogger(config);
                    log.LogWarning(msgerr.Replace("<<Corporate>>", txtCorporateFullName.Text));
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.CorporatedeleteMessage.Replace("<<Corporate>>", txtCorporateFullName.Text), true);
                }
            }
            catch (Exception ex)
            {
                EventLogger log = new EventLogger(config);
                log.LogException(ex);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.CorporateErrorMessage.Replace("<<Corporate>>", ex.Message.ToString()), true);
            }
        }
コード例 #7
0
        protected void btnsave_Click(object sender, EventArgs e)
        {
            try
            {
                EventLogger              log = new EventLogger(config);
                string                   FacilityVendorAcct = string.Empty;
                string                   lstrMessage        = string.Empty;
                InventoryServiceClient   service            = new InventoryServiceClient();
                BALFacilityVendorAccount obj = new BALFacilityVendorAccount();
                obj.FacilityVendorAccID = Convert.ToInt64(hdnFVAccountID.Value);
                obj.FacilityID          = Convert.ToInt64(drdFacilityName.SelectedValue);
                obj.VendorID            = Convert.ToInt64(drdVendorName.SelectedValue);
                obj.ShipAccount         = txtShipAccount.Text;
                obj.BillAccount         = txtBillAccount.Text;
                obj.CreatedBy           = defaultPage.UserId;
                obj.CreatedOn           = DateTime.Now;
                if (chkactive.Checked == true)
                {
                    obj.IsActive = true;
                }
                else
                {
                    obj.IsActive = false;
                }

                if (obj.FacilityVendorAccID == 0)
                {
                    List <GetFacilityVendorAccount> lstcount = service.GetFacilityVendorAccount(drdFacilityName.SelectedItem.Text).Where(o => o.VendorDescription == drdVendorName.SelectedItem.Text.ToString()).ToList();
                    if (lstcount.Count <= 0)
                    {
                        lstrMessage        = service.InsertUpdateFacilityVendorAccount(obj);
                        FacilityVendorAcct = drdFacilityName.SelectedItem.Text + " " + drdVendorName.SelectedItem.Text;
                        log.LogInformation(msgwrn.Replace("<<FacilityDescription>>", FacilityVendorAcct.ToString()));
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.FacilityVendorAccountSaveMessage.Replace("<<FacilityDescription>>", FacilityVendorAcct.ToString()), true);
                    }
                    else
                    {
                        //Functions objfun = new Functions();
                        //objfun.MessageDialog(this, "Record Exist");
                        string msg = Constant.WarningFacilityVendorAccountMessage.Replace("ShowwarningLookupPopup('", "").Replace("<<FacilityDescription>>", "Record Exists").Replace("');", "");
                        log.LogWarning(msg);
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.WarningFacilityVendorAccountMessage.Replace("<<FacilityDescription>>", "Record Exists"), true);
                    }
                }
                else
                {
                    if (!ValidateLoookups(service))
                    {
                        return;
                    }

                    List <GetFacilityVendorAccount> lstcount = service.GetFacilityVendorAccount(drdFacilityName.SelectedItem.Text).Where(o => o.VendorDescription == drdVendorName.SelectedItem.Text.ToString() && o.FacilityVendorAccID != obj.FacilityVendorAccID).ToList();
                    if (lstcount.Count == 0)
                    {
                        lstrMessage        = service.InsertUpdateFacilityVendorAccount(obj);
                        FacilityVendorAcct = drdFacilityName.SelectedItem.Text + " " + drdVendorName.SelectedItem.Text;
                        log.LogInformation(msgwrn.Replace("<<FacilityDescription>>", FacilityVendorAcct.ToString()));
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.FacilityVendorAccountSaveMessage.Replace("<<FacilityDescription>>", FacilityVendorAcct.ToString()), true);
                    }
                    else
                    {
                        //Functions objfun = new Functions();
                        //objfun.MessageDialog(this, "The Record Entered is alredy Exist");
                        string msg = Constant.FacilityVendorAccountErrorMessage.Replace("ShowdelPopup('", "").Replace("<<FacilityDescription>>", "The record entered is already exist").Replace("');", "");
                        log.LogWarning(msg);
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.FacilityVendorAccountErrorMessage.Replace("<<FacilityDescription>>", "The record entered is already exist"), true);
                    }
                }

                if (lstrMessage == "Saved Successfully")
                {
                    //Functions objfun = new Functions();
                    //objfun.MessageDialog(this, "Saved Successfully");
                    //txtSearchFacility.Text = "";
                    BindGrid();
                    drdFacilityName.SelectedIndex = 0;
                    drdVendorName.SelectedIndex   = 0;
                    txtBillAccount.Text           = "";
                    txtShipAccount.Text           = "";
                    hdnFVAccountID.Value          = "0";
                    ToggleAdd("Clear");
                }
            }

            catch (Exception ex)
            {
                EventLogger log = new EventLogger(config);
                log.LogException(ex);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.FacilityVendorAccountErrorMessage.Replace("<<FacilityDescription>>", ex.Message), true);
            }
        }
コード例 #8
0
 protected void btnsave_Click(object sender, EventArgs e)
 {
     try
     {
         EventLogger            log         = new EventLogger(config);
         InventoryServiceClient lclsService = new InventoryServiceClient();
         if (hdnfield.Value != "0")
         {
             lcls.UomID = Convert.ToInt64(hdnfield.Value);
         }
         lcls.UomName        = txtUomName.Text;
         lcls.CreatedBy      = defaultPage.UserId;
         lcls.CreatedOn      = DateTime.Now;
         lcls.LastModifiedBy = defaultPage.UserId;
         if (chkactive.Checked == true)
         {
             lcls.IsActive = true;
         }
         else
         {
             lcls.IsActive = false;
         }
         List <GetUOMName> lstuomname = new List <GetUOMName>();
         lstuomname = lclsService.GetUOMName(txtUomName.Text).ToList();
         if (lstuomname.Count <= 0)
         {
             string lstrMessage = lclsService.InsertUOM(lcls);
             {
                 List <GetUom> lstUOM = lclsService.GetUom().ToList();
                 log.LogInformation(msgwrn.Replace("<<UOM>>", txtUomName.Text));
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.UOMSaveMessage.Replace("<<UOM>>", txtUomName.Text), true);
                 hdnfield.Value = "0";
             }
             bindUom();
             clear();
         }
         else
         {
             if (lstuomname[0].UomID == Convert.ToInt64(lcls.UomID))
             {
                 string lstrMessage = lclsService.InsertUOM(lcls);
                 {
                     List <GetUom> lstUOM = lclsService.GetUom().ToList();
                     log.LogInformation(msgwrn.Replace("<<UOM>>", txtUomName.Text));
                     ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.UOMSaveMessage.Replace("<<UOM>>", txtUomName.Text), true);
                     hdnfield.Value = "0";
                 }
                 bindUom();
                 clear();
             }
             else
             {
                 string msg = Constant.UOMDeleteMessage.Replace("ShowdelPopup('", "").Replace("<<UOM>>", "Unit Of Measurement value already exists create a new UOM").Replace("');", "");
                 log.LogWarning(msg);
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.UOMDeleteMessage.Replace("<<UOM>>", "Unit Of Measurement value already exists create a new UOM"), true);
             }
         }
     }
     catch (Exception ex)
     {
         EventLogger log = new EventLogger(config);
         log.LogException(ex);
         ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.UOMErrorMessage.Replace("<<UOM>>", ex.Message), true);
     }
 }
コード例 #9
0
        protected void btnsave_Click(object sender, EventArgs e)
        {
            try
            {
                EventLogger log  = new EventLogger(config);
                BALItem     lcls = new BALItem();
                if (ItemID.Value != null && ItemID.Value != "")
                {
                    lcls.ItemID = Convert.ToInt64(ItemID.Value);
                }
                //txtitemid.Text = Convert.ToString(lcls.ItemID);
                //lcls.ItemShortName = txtitemid.Text;
                lcls.ItemDescription = txtItemDesc.Text;
                lcls.CategoryID      = Convert.ToInt64(drdItemCategory.SelectedValue);
                lcls.QtyPack         = Convert.ToInt64(txtQty.Text);
                lcls.NDC             = txtNDC.Text;
                decimal E = 0;
                E = Convert.ToDecimal(txtunitvalue.Text) / Convert.ToInt64(txtQty.Text);
                lcls.EachPrice         = Convert.ToDecimal(E.ToString());
                lcls.UnitPriceCurrency = Convert.ToString(drdUnitpriceType.SelectedValue);
                lcls.UnitPriceValue    = Convert.ToDecimal(txtunitvalue.Text);
                lcls.UOM           = Convert.ToInt64(ddlUOM.SelectedValue);
                lcls.GPBillingCode = txtgpbill.Text;
                //if (chkstan.Checked == true)
                //{
                //    lcls.Standard = true;
                //}
                //else
                //{
                //    lcls.Standard = false;
                //}
                //if (chknonstan.Checked == true)
                //{
                //    lcls.NonStandard = true;
                //}
                //else
                //{
                //    lcls.NonStandard = false;
                //}
                lcls.CreatedBy      = defaultPage.UserId;
                lcls.CreatedOn      = DateTime.Now;
                lcls.LastModifiedBy = defaultPage.UserId;
                lcls.LastModifiedOn = DateTime.Now;
                if (!ValidateLoookups(lclsservice))
                {
                    return;
                }
                bool isdescvalid = false;
                bool idgpcdoe    = false;
                if (chkactive.Checked == true)
                {
                    lcls.IsActive = true;
                }
                else
                {
                    lcls.IsActive = false;
                }
                List <GetItemDescName> lstitemdesc = lclsservice.GetItemDescName(txtItemDesc.Text).ToList();
                if (lstitemdesc.Count <= 0 || txtItemDesc.Text == "")
                {
                    isdescvalid = true;
                }
                else if (lstitemdesc[0].ItemID == Convert.ToInt64(lcls.ItemID))
                {
                    isdescvalid = true;
                }
                List <Validgpbillcode> lstMaster = lclsservice.Validgpbillcode(txtgpbill.Text).ToList();
                if (lstMaster.Count <= 0 || txtgpbill.Text == "")
                {
                    idgpcdoe = true;
                }
                else if (lstMaster[0].ItemID == Convert.ToInt64(lcls.ItemID))
                {
                    idgpcdoe = true;
                }

                if (isdescvalid == true && idgpcdoe == true)
                {
                    string lstrMessage = lclsservice.InsertUpdateItem(lcls);
                    string msg         = Constant.MedicalSuppliesSaveMessage.Replace("ShowPopup('", "").Replace("<<Itemname>>", txtItemDesc.Text).Replace("');", "");
                    log.LogInformation(msg);
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.MedicalSuppliesSaveMessage.Replace("<<Itemname>>", txtItemDesc.Text), true);
                    BindItem();
                    txtSearchItem.Text = "";
                    Clear();
                }
                else
                {
                    if (isdescvalid == false)
                    {
                        string msg = Constant.MedicalSuppliesvailddescMessage.Replace("ShowwarningLookupPopup('", "").Replace("<<Itemname>>", txtItemDesc.Text).Replace("');", "");
                        log.LogWarning(msg);
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.MedicalSuppliesvailddescMessage.Replace("<<Itemname>>", txtItemDesc.Text), true);
                    }
                    else
                    {
                        string msg = Constant.MedicalSuppliesvaildgpMessage.Replace("ShowwarningLookupPopup('", "").Replace("<<Itemname>>", txtgpbill.Text).Replace("');", "");
                        log.LogWarning(msg);
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.MedicalSuppliesvaildgpMessage.Replace("<<Itemname>>", txtgpbill.Text), true);
                    }
                }
            }
            catch (Exception ex)
            {
                EventLogger log = new EventLogger(config);
                log.LogException(ex);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.MedicalSuppliesErrorMessage.Replace("<<Itemname>>", ex.Message), true);
            }
        }
コード例 #10
0
        protected void btnsave_Click(object sender, EventArgs e)
        {
            try
            {
                if (hdnfield.Value != "0")
                {
                    lcls.CategoryID = Convert.ToInt64(hdnfield.Value);
                }
                lcls.CategoryName = txtGroupName.Text;
                if (chkstan.Checked == true)
                {
                    lcls.Usage = "1";
                }
                else if (chknonstan.Checked == true)
                {
                    lcls.Usage = "0";
                }
                else
                {
                    lcls.Usage = null;
                }
                if (chkactive.Checked == true)
                {
                    lcls.IsActive = true;
                }
                else
                {
                    lcls.IsActive = false;
                }
                lcls.CreatedOn      = DateTime.Now;
                lcls.CreatedBy      = defaultPage.UserId;
                lcls.LastModifiedBy = defaultPage.UserId;
                string ErrMsg = string.Empty;
                List <GetItemCategory> lstcat = lclsService.GetItemCategory().Where(a => a.CategoryName == txtGroupName.Text).ToList();

                if (lstcat.Count > 0)
                {
                    if (lcls.CategoryID == 0)
                    {
                        ErrMsg = "FC";
                    }
                    else
                    {
                        if (lcls.CategoryID != lstcat[0].CategoryID)
                        {
                            ErrMsg = "FC";
                        }
                    }
                }

                if (ErrMsg == "")
                {
                    string      lstrMessage = lclsService.InsertUpdateCategory(lcls);
                    EventLogger log         = new EventLogger(config);
                    string      msg         = Constant.ItemCategorySaveMessage.Replace("ShowPopup('", "").Replace("<<ItemCategory>>", txtGroupName.Text).Replace("');", "");
                    log.LogInformation(msg);
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.ItemCategorySaveMessage.Replace("<<ItemCategory>>", txtGroupName.Text), true);
                    hdnfield.Value = "0";
                    bindgrid();
                    clear();
                }
                else
                {
                    EventLogger log = new EventLogger(config);
                    string      msg = Constant.ItemCategoryWarningMessage.Replace("ShowwarningPopup('", "").Replace("<<ItemCategory>>", txtGroupName.Text).Replace("');", "");
                    log.LogWarning(msg);
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.ItemCategoryWarningMessage.Replace("<<ItemCategory>>", txtGroupName.Text), true);
                }
                //Functions objfun = new Functions();
                //objfun.MessageDialog(this, "Saved Successfully");
            }
            catch (Exception ex)
            {
                EventLogger log = new EventLogger(config);
                log.LogException(ex);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.ItemCategoryErrorMessage.Replace("<<ItemCategory>>", ex.Message), true);
            }
        }
コード例 #11
0
        public void UpdateCorporate()
        {
            try
            {
                EventLogger log       = new EventLogger(config);
                bool        iscorp    = false;
                bool        isCorpesc = false;
                ObjCorporate.CorporateID          = Convert.ToInt64(HiddenCorporateMasterID.Value);
                ObjCorporate.CorporateName        = txtCorporateFullName.Text;
                ObjCorporate.CorporateDescription = txtCorporateDesc.Text;
                ObjCorporate.POEmail          = txtPOEmail.Text;
                ObjCorporate.LastModifiededBy = defaultPage.UserId;
                if (chkstatus.Checked == true)
                {
                    ObjCorporate.IsActive = true;
                }
                else
                {
                    ObjCorporate.IsActive = false;
                }
                List <BindCorporateMaster> lstCop = lclsservice.BindCorporateMaster().Where(a => a.CorporateName == ObjCorporate.CorporateName).ToList();
                if (lstCop.Count <= 0 || txtCorporateFullName.Text == "")
                {
                    iscorp = true;
                }
                else if (lstCop[0].CorporateID == Convert.ToInt64(ObjCorporate.CorporateID))
                {
                    iscorp = true;
                }

                List <BindCorporateMaster> lstCorpdesc = lclsservice.BindCorporateMaster().Where(a => a.CorporateDescription == ObjCorporate.CorporateDescription).ToList();
                if (lstCorpdesc.Count <= 0 || txtCorporateDesc.Text == "")
                {
                    isCorpesc = true;
                }
                else if (lstCorpdesc[0].CorporateID == Convert.ToInt64(ObjCorporate.CorporateID))
                {
                    isCorpesc = true;
                }

                if (iscorp == true && isCorpesc == true)
                {
                    update = lclsservice.UpdateCorporateMaster(ObjCorporate);
                    if (update == "Updated Successfully")
                    {
                        string msg = Constant.CorporateUpdateMessage.Replace("ShowPopup('", "").Replace("<<Corporate>>", "").Replace("');", "");
                        log.LogInformation(msg);
                        //lclsservice.DeleteCorporateDetails(Convert.ToInt64(HiddenCorporateMasterID.Value), true, defaultPage.UserId);
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.CorporateUpdateMessage.Replace("<<Corporate>>", ""), true);
                        BindGrid();
                        clear();
                    }
                }
                else
                {
                    if (iscorp == false)
                    {
                        log.LogWarning(msgwrn.Replace("<<Corporate>>", txtCorporateFullName.Text));
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.WarningValidCorporateMessage.Replace("<<Corporate>>", txtCorporateFullName.Text), true);
                    }
                    else
                    {
                        log.LogWarning(logmsg.Replace("<<Corporate>>", txtCorporateDesc.Text));
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.WarningValidCorporatecdescMessage.Replace("<<Corporate>>", txtCorporateDesc.Text), true);
                    }
                }
            }
            catch (Exception ex)
            {
                EventLogger log = new EventLogger(config);
                log.LogException(ex);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.CorporateErrorMessage.Replace("<<Corporate>>", ex.Message.ToString()), true);
            }
        }