Exemple #1
0
 protected void GvCustomer_Select(object sender, Obout.Grid.GridRecordEventArgs e)
 {
     try
     {
         CustomProfile   profile = CustomProfile.GetProfile();
         iCustomerClient ServiceAccountMaster = new iCustomerClient();
         tCustomerHead   objCutomerHead       = new tCustomerHead();
         clr();
         Hashtable selectedrec = (Hashtable)GvCustomer.SelectedRecords[0];
         HdnAccountId.Value = selectedrec["ID"].ToString();
         GetVendorDetailByID();
         GetVendorOpeningBal();
         GetVendorRatecard();
         Session.Add("PORRequestID", "Company");
         FillUserControl(Convert.ToInt64(HdnAccountId.Value));
         ActiveTab("Edit");
     }
     catch (System.Exception ex)
     {
         Login.Profile.ErrorHandling(ex, this, "Account Master", "GvCustomer_Select");
     }
     finally
     {
     }
 }
Exemple #2
0
        public void bindDropdown()
        {
            try
            {
                CustomProfile   profile = CustomProfile.GetProfile();
                iCustomerClient ServiceAccountMaster = new iCustomerClient();
                Ddl_CompanyType.DataSource = ServiceAccountMaster.GetCompanyType(profile.DBConnection._constr);
                Ddl_CompanyType.DataBind();
                ListItem lst1 = new ListItem();
                lst1.Text  = "-Select-";
                lst1.Value = "0";
                Ddl_CompanyType.Items.Insert(0, lst1);

                Ddl_Sector.DataSource = ServiceAccountMaster.GetLeadSector(profile.DBConnection._constr);
                Ddl_Sector.DataBind();
                Ddl_Sector.Items.Insert(0, lst1);
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Account Master", "bindDropdown");
            }
            finally
            {
            }
        }
        protected void GetVendorOpeningBal()
        {
            CustomProfile   profile = CustomProfile.GetProfile();
            iCustomerClient ServiceAccountMaster = new iCustomerClient();

            try
            {
                tOpeningBalance objTOpeningBal = new tOpeningBalance();
                objTOpeningBal          = ServiceAccountMaster.GetTOpeningBalanceDtls(Convert.ToInt64(HdnAccountId.Value), "Client", profile.DBConnection._constr);
                txt_OpeningBalance.Text = objTOpeningBal.OpeningBalance.ToString();
                if (objTOpeningBal.FinancialYear != null)
                {
                    ddl_FinancialYr.SelectedValue = objTOpeningBal.FinancialYear.ToString();
                }
                if (objTOpeningBal.DrCr != null)
                {
                    ddl_DrCr.SelectedValue = objTOpeningBal.DrCr.ToString();
                }
                HdnOpeningBalId.Value = objTOpeningBal.ID.ToString();
            }
            catch (Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Client Master", "GetVendorOpeningBal");
            }
            finally
            {
                ServiceAccountMaster.Close();
            }
        }
        public void GetClientDetailByClientID()
        {
            CustomProfile   profile = CustomProfile.GetProfile();
            iCustomerClient ServiceAccountMaster = new iCustomerClient();

            try
            {
                mClient client = new mClient();

                client = ServiceAccountMaster.GetClientDetailByClientID(Convert.ToInt64(HdnAccountId.Value), profile.DBConnection._constr);
                FillCompany();
                if (client.CompanyID != null)
                {
                    ddlcompany.SelectedIndex = ddlcompany.Items.IndexOf(ddlcompany.Items.FindByValue(client.CompanyID.ToString()));
                }
                hdnCompanyid.Value = client.CompanyID.ToString();
                getCustomer(long.Parse(client.CompanyID.ToString()));
                if (client.CustomerID != null)
                {
                    ddlcustomer.SelectedIndex = ddlcustomer.Items.IndexOf(ddlcustomer.Items.FindByValue(client.CustomerID.ToString()));
                }
                hdncustomerid.Value           = client.CustomerID.ToString();
                txt_custname.Text             = client.Name.ToString();
                txt_custcode.Text             = client.Code.ToString();
                txt_turnOver.Text             = client.TurnOver.ToString();
                TxtWebsite.Text               = client.Website.ToString();
                txt_CreditDays.Text           = client.Creditdays.ToString();
                Ddl_CompanyType.SelectedValue = null;
                if (client.CompType != null)
                {
                    Ddl_CompanyType.SelectedValue = (client.CompType).ToString();
                }
                Ddl_Sector.SelectedValue = (client.Sector).ToString();
                if (client.Active == "Y")
                {
                    rbtnYes.Checked = true;
                }
                else
                {
                    rbtnNo.Checked = true;
                }
            }
            catch (Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Client Master", "GetClientDetailByClientID");
            }
            finally
            {
                ServiceAccountMaster.Close();
            }
        }
        protected void btnSubmit_Click(object sender, System.EventArgs e)
        {
            string        Prime = "", Express = "", Regular = "", DID = "";
            CustomProfile profile = CustomProfile.GetProfile();

            BrilliantWMS.AccountSearchService.iCustomerClient cust = new iCustomerClient();
            mSLA sla = new mSLA();

            if (txtPrime.Text == "NA")
            {
                Prime = "0";
            }
            else
            {
                Prime = txtPrime.Text;
            }
            if (txtExpress.Text == "NA")
            {
                Express = "0";
            }
            else
            {
                Express = txtExpress.Text;
            }
            if (txtRegular.Text == "NA")
            {
                Regular = "0";
            }
            else
            {
                Regular = txtRegular.Text;
            }
            if (hdndeptid.Value == "NA")
            {
                DID = "0";
            }
            else
            {
                DID = hdndeptid.Value;
            }
            sla.PrimeDays   = long.Parse(Prime);
            sla.ExpressDays = long.Parse(Express);
            sla.RegularDays = long.Parse(Regular);
            sla.DeptID      = long.Parse(DID);
            sla.CreatedBy   = profile.Personal.UserID;
            sla.CreatedDate = DateTime.Now;
            cust.AddIntomSLA(sla, profile.DBConnection._constr);
            Response.Write("<script>window.close();</" + "script>");
            Response.End();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Lang"] == "")
            {
                Session["Lang"] = Request.UserLanguages[0];
            }
            loadstring();
            string DptID = Request.QueryString["DEPTID"].ToString();

            hdndeptid.Value = Request.QueryString["DEPTID"].ToString();
            if (!IsPostBack)
            {
                if (DptID != "0")
                {
                    CustomProfile profile = CustomProfile.GetProfile();
                    BrilliantWMS.AccountSearchService.iCustomerClient cust = new iCustomerClient();
                    mSLA sla = new mSLA();
                    sla = cust.GetSLADetailsDeptWise(long.Parse(DptID), profile.DBConnection._constr);
                    if (sla != null)
                    {
                        if (sla.PrimeDays == 0)
                        {
                            chkPrime.Checked = false;
                        }
                        else
                        {
                            chkPrime.Checked = true; txtPrime.Text = sla.PrimeDays.ToString(); txtPrime.Enabled = true;
                        }
                        if (sla.ExpressDays == 0)
                        {
                            chkExpress.Checked = false;
                        }
                        else
                        {
                            chkExpress.Checked = true; txtExpress.Text = sla.ExpressDays.ToString(); txtExpress.Enabled = true;
                        }
                        if (sla.RegularDays == 0)
                        {
                            chkRegular.Checked = false;
                        }
                        else
                        {
                            chkRegular.Checked = true; txtRegular.Text = sla.RegularDays.ToString(); txtRegular.Enabled = true;
                        }
                    }
                }
            }
        }
Exemple #7
0
        protected void GetVendorDetailByID()
        {
            CustomProfile   profile = CustomProfile.GetProfile();
            iCustomerClient ServiceAccountMaster = new iCustomerClient();
            mVendor         vendor = new mVendor();

            vendor = ServiceAccountMaster.GetVendorDetailByVendorID(Convert.ToInt64(HdnAccountId.Value), profile.DBConnection._constr);
            //objCutomerHead = ServiceAccountMaster.GetCustomerHeadDetailByCustomerID(Convert.ToInt64(HdnAccountId.Value), profile.DBConnection._constr);


            FillCompany();
            if (vendor.CompanyID != null)
            {
                ddlcompany.SelectedIndex = ddlcompany.Items.IndexOf(ddlcompany.Items.FindByValue(vendor.CompanyID.ToString()));
            }
            hdnCompanyid.Value = vendor.CompanyID.ToString();
            getCustomer(long.Parse(vendor.CompanyID.ToString()));
            if (vendor.CustomerID != null)
            {
                ddlcustomer.SelectedIndex = ddlcustomer.Items.IndexOf(ddlcustomer.Items.FindByValue(vendor.CustomerID.ToString()));
            }
            hdncustomerid.Value = vendor.CustomerID.ToString();
            if (vendor.VCType != null)
            {
                ddlvendortype.SelectedIndex = ddlvendortype.Items.IndexOf(ddlvendortype.Items.FindByValue(vendor.VCType.ToString()));
            }

            txt_custname.Text             = vendor.Name.ToString();
            txt_custcode.Text             = vendor.Code.ToString();
            txt_turnOver.Text             = vendor.TurnOver.ToString();
            TxtWebsite.Text               = vendor.Website.ToString();
            txt_CreditDays.Text           = vendor.Creditdays.ToString();
            Ddl_CompanyType.SelectedValue = null;
            if (vendor.CompType != null)
            {
                Ddl_CompanyType.SelectedValue = (vendor.CompType).ToString();
            }
            Ddl_Sector.SelectedValue = (vendor.Sector).ToString();
            if (vendor.Active == "Y")
            {
                rbtnYes.Checked = true;
            }
            else
            {
                rbtnNo.Checked = true;
            }
        }
        public static int WMAddIntomSLA(string Prime, string Express, string Regular, string DID)
        {
            CustomProfile profile = CustomProfile.GetProfile();

            BrilliantWMS.AccountSearchService.iCustomerClient cust = new iCustomerClient();
            mSLA sla = new mSLA();

            sla.DeptID = long.Parse(DID);
            long Pr = 0, Exp = 0, Reg = 0;

            if (Prime == "NA")
            {
                Pr = 0;
            }
            else
            {
                Pr = Convert.ToInt64(Prime);
            }
            if (Express == "NA")
            {
                Exp = 0;
            }
            else
            {
                Exp = Convert.ToInt64(Express);
            }
            if (Regular == "NA")
            {
                Reg = 0;
            }
            else
            {
                Reg = Convert.ToInt64(Regular);
            }

            sla.PrimeDays   = Pr;
            sla.ExpressDays = Exp;
            sla.RegularDays = Reg;

            sla.CreatedBy   = profile.Personal.UserID;
            sla.CreatedDate = DateTime.Now;

            cust.AddIntomSLA(sla, profile.DBConnection._constr);
            return(1);
        }
Exemple #9
0
        protected void GetVendorOpeningBal()
        {
            CustomProfile   profile = CustomProfile.GetProfile();
            iCustomerClient ServiceAccountMaster = new iCustomerClient();
            tOpeningBalance objTOpeningBal       = new tOpeningBalance();

            objTOpeningBal          = ServiceAccountMaster.GetTOpeningBalanceDtls(Convert.ToInt64(HdnAccountId.Value), "Vendor", profile.DBConnection._constr);
            txt_OpeningBalance.Text = objTOpeningBal.OpeningBalance.ToString();
            if (objTOpeningBal.FinancialYear != null)
            {
                ddl_FinancialYr.SelectedValue = objTOpeningBal.FinancialYear.ToString();
            }
            if (objTOpeningBal.DrCr != null)
            {
                ddl_DrCr.SelectedValue = objTOpeningBal.DrCr.ToString();
            }
            HdnOpeningBalId.Value = objTOpeningBal.ID.ToString();
        }
Exemple #10
0
 public string checkDuplicate()
 {
     try
     {
         string        result  = "";
         CustomProfile profile = CustomProfile.GetProfile();
         //AccountSearchService.AccountSearchService ServiceAccountMaster = new AccountSearchService.AccountSearchService();
         iCustomerClient ServiceAccountMaster = new iCustomerClient();
         if (HdnAccountId.Value == string.Empty)
         {
             result = ServiceAccountMaster.checkDuplicateRecord(txt_custname.Text, txt_custcode.Text, profile.DBConnection._constr);
             if (result != string.Empty)
             {
                 WebMsgBox.MsgBox.Show(result);
                 txt_custname.Text = "";
                 txt_custcode.Text = "";
             }
             txt_custname.Focus();
         }
         else
         {
             int id = Convert.ToInt32(HdnAccountId.Value);
             result = ServiceAccountMaster.checkDuplicateRecordEdit(id, txt_custname.Text, txt_custcode.Text, profile.DBConnection._constr);
             if (result != string.Empty)
             {
                 WebMsgBox.MsgBox.Show(result);
                 txt_custname.Text = "";
                 txt_custcode.Text = "";
             }
         }
         return(result);
     }
     catch (System.Exception ex)
     {
         Login.Profile.ErrorHandling(ex, this, "Account Master", "checkDuplicate");
         string result = "";
         return(result);
     }
     finally
     {
     }
 }
Exemple #11
0
        protected void pageSave(Object sender, ToolbarService.iUCToolbarClient e)
        {
            try
            {
                CustomProfile   profile = CustomProfile.GetProfile();
                iCustomerClient ServiceAccountMaster = new iCustomerClient();
                mVendor         Objvendor            = new mVendor();
                tCustomerHead   objCutomerHead       = new tCustomerHead();
                tOpeningBalance objOpeningBal        = new tOpeningBalance();
                int             result;
                long            Result1;
                if (checkDuplicate() == "")
                {
                    if (HdnAccountId.Value != "" && HdnAccountId.Value != "0")
                    {
                        //objCutomerHead = ServiceAccountMaster.GetCustomerHeadDetailByCustomerID(Convert.ToInt64(HdnAccountId.Value), profile.DBConnection._constr);
                        Objvendor     = ServiceAccountMaster.GetVendorDetailByVendorID(Convert.ToInt64(HdnAccountId.Value), profile.DBConnection._constr);
                        objOpeningBal = ServiceAccountMaster.GetTOpeningBalanceDtls(Convert.ToInt64(HdnAccountId.Value), "Vendor", profile.DBConnection._constr);
                        objCutomerHead.LastModifiedBy   = profile.Personal.UserID.ToString();
                        objCutomerHead.LastModifiedDate = DateTime.Now;
                    }
                    else
                    {
                        objCutomerHead.CreatedBy    = profile.Personal.UserID.ToString();
                        objCutomerHead.CreationDate = DateTime.Now;
                    }

                    Objvendor.Name       = txt_custname.Text;
                    Objvendor.CompanyID  = long.Parse(ddlcompany.SelectedItem.Value);
                    Objvendor.Code       = txt_custcode.Text;
                    Objvendor.Sector     = Convert.ToInt64(Ddl_Sector.SelectedItem.Value);
                    Objvendor.VCType     = Convert.ToInt64(ddlvendortype.SelectedItem.Value);
                    Objvendor.Creditdays = Convert.ToInt64(txt_CreditDays.Text);
                    Objvendor.TurnOver   = decimal.Parse(txt_turnOver.Text);
                    Objvendor.CompType   = Convert.ToInt64(Ddl_CompanyType.SelectedItem.Value);
                    if (rbtnYes.Checked == true)
                    {
                        Objvendor.Active = "Y";
                    }
                    if (rbtnNo.Checked == true)
                    {
                        Objvendor.Active = "N";
                    }
                    Objvendor.CustomerID  = long.Parse(hdncustomerid.Value);
                    Objvendor.Website     = TxtWebsite.Text;
                    Objvendor.AccountType = "Vendor";

                    /* if (Ddl_CompanyType.SelectedIndex > 0) objCutomerHead.CustomerTypeID = Convert.ToInt64(Ddl_CompanyType.SelectedItem.Value);
                     *
                     * objCutomerHead.CustomerCode = null;
                     * if (txt_custcode.Text.ToString().Trim() != "") objCutomerHead.CustomerCode = (txt_custcode.Text).ToString();
                     *
                     * if (Ddl_Sector.SelectedIndex > 0) objCutomerHead.SectorID = Convert.ToInt64(Ddl_Sector.SelectedItem.Value);
                     *
                     * objCutomerHead.Name = null;
                     * if (txt_custname.Text.ToString().Trim() != "") objCutomerHead.Name = (txt_custname.Text).ToString();
                     *
                     * objCutomerHead.WebSite = null;
                     * if (TxtWebsite.Text.ToString().Trim() != "") objCutomerHead.WebSite = (TxtWebsite.Text).ToString();
                     *
                     * objCutomerHead.TurnOver = null;
                     * if (txt_turnOver.Text.ToString().Trim() != "") objCutomerHead.TurnOver = (txt_turnOver.Text).ToString();
                     *
                     *
                     * objCutomerHead.CreditDays = null;
                     * if (txt_CreditDays.Text.ToString().Trim() != "") objCutomerHead.CreditDays = Convert.ToInt32(txt_CreditDays.Text);
                     *
                     * if (rbtnYes.Checked == true) objCutomerHead.Active = "Y";
                     * if (rbtnNo.Checked == true) objCutomerHead.Active = "N";
                     *
                     * objCutomerHead.BillingAddressID = Convert.ToInt64(UCAddress1.BillingSeq);
                     * objCutomerHead.ShippingAddressID = Convert.ToInt64(UCAddress1.ShippingSeq);
                     *
                     * objCutomerHead.ConperID = UCContactPerson1.ContactPersonIDs;*/

                    objOpeningBal.FinancialYear = null;
                    if (ddl_FinancialYr.SelectedIndex > 0)
                    {
                        objOpeningBal.FinancialYear = ddl_FinancialYr.SelectedValue;
                    }

                    objOpeningBal.ObjectName = "Vendor";

                    objOpeningBal.OpeningBalance = null;
                    if (txt_OpeningBalance.Text.ToString().Trim() != "")
                    {
                        objOpeningBal.OpeningBalance = Convert.ToDecimal((txt_OpeningBalance.Text).ToString());
                    }

                    objOpeningBal.DrCr = null;
                    if (ddl_DrCr.SelectedIndex > 0)
                    {
                        objOpeningBal.DrCr = ddl_DrCr.SelectedValue;
                    }

                    //objOpeningBal.ID = Convert.ToInt64(HdnOpeningBalId.Value.ToString());

                    if (HdnAccountId.Value == string.Empty)
                    {
                        //objCutomerHead.CreatedBy = profile.Personal.UserID.ToString();
                        //objCutomerHead.CreationDate = DateTime.Now;
                        //objCutomerHead.CompanyID = profile.Personal.CompanyID;
                        Objvendor.CreatedBy    = profile.Personal.UserID.ToString();
                        Objvendor.CreationDate = DateTime.Now;
                        // result = ServiceAccountMaster.SaveCustomerDetails(objCutomerHead, "AddNew", profile.DBConnection._constr);
                        result = ServiceAccountMaster.SaveVendorDetails(Objvendor, "AddNew", profile.DBConnection._constr);
                    }
                    else
                    {
                        //objCutomerHead.LastModifiedBy = profile.Personal.UserID.ToString();
                        //objCutomerHead.LastModifiedDate = DateTime.Now;
                        Objvendor.LastModifiedBy   = profile.Personal.UserID.ToString();
                        Objvendor.LastModifiedDate = DateTime.Now;
                        //result = ServiceAccountMaster.SaveCustomerDetails(objCutomerHead, "Edit", profile.DBConnection._constr);
                        result = ServiceAccountMaster.SaveVendorDetails(Objvendor, "Edit", profile.DBConnection._constr);
                    }

                    objOpeningBal.ReferenceID = result;
                    HdnAccountId.Value        = result.ToString();
                    if (HdnOpeningBalId.Value == "0" || HdnOpeningBalId.Value == "")
                    {
                        objOpeningBal.CreatedBy   = profile.Personal.UserID.ToString();
                        objOpeningBal.CreatedDate = DateTime.Now;
                        // Result1 = ServiceAccountMaster.SaveOpeningBalance(objOpeningBal, "AddNew", profile.DBConnection._constr);
                        Result1 = ServiceAccountMaster.SaveAccountOpeningBal(objOpeningBal, profile.DBConnection._constr);
                    }
                    else
                    {
                        objOpeningBal.LastModifiedBy   = profile.Personal.UserID.ToString();
                        objOpeningBal.LastModifiedDate = DateTime.Now;
                        // Result1 = ServiceAccountMaster.SaveOpeningBalance(objOpeningBal, "Edit", profile.DBConnection._constr);
                        Result1 = ServiceAccountMaster.SaveAccountOpeningBal(objOpeningBal, profile.DBConnection._constr);
                    }
                    HdnOpeningBalId.Value = Result1.ToString();
                    UCAddress1.FinalSaveAddress(Address.ReferenceObjectName.Vendor, result);
                    UCContactPerson1.FinalSaveContactPerson("Vendor", result);
                    UC_AttachDocument1.FinalSaveDocument(result);
                    /*   UC_StatutoryDetails1.FinalSaveToStatutoryDetails(Convert.ToInt64(result), "Customer", profile.Personal.CompanyID);*/
                    if (result != 0)
                    {
                        WebMsgBox.MsgBox.Show("Record saved successfully");
                    }
                    clr();
                    MainCustomerGridBind();
                    // FillUserControl(result);
                    ActiveTab("Load");
                }
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Account Master", "pageSave");
            }
            finally
            {
            }
        }