Exemplo n.º 1
0
        public ActionResult Get_ReportData(string t)
        {
            string OrganizationCode = "";

            if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
            {
                OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim();
            }

            if (t.Trim().ToUpper() == "E")
            {
                using (Expense_Svc.ExpenseServiceClient iGstSvc = new Expense_Svc.ExpenseServiceClient())
                {
                    ViewBag.ReportType = "E";
                    ViewBag.ReportData = iGstSvc.GetList_Expense("", "", "", OrganizationCode, "", "", "", "");
                }
            }
            else if (t.Trim().ToUpper() == "S")
            {
                using (Bill_Svc.BillServiceClient iGstSvc = new Bill_Svc.BillServiceClient())
                {
                    ViewBag.ReportType = "S";
                    ViewBag.ReportData = iGstSvc.GetList_Bill("", "", "", OrganizationCode, "", "", "", "");
                }
            }
            else
            {
                ViewBag.ReportType = null;
                ViewBag.ReportData = null;
            }

            return(View("~/Views/MasterPages/Reports.cshtml"));
        }
        public ActionResult GetDetails_Supplier(string CustomerID)
        {
            string OrganizationCode = "";

            if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
            {
                OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim();
            }

            using (Bill_Svc.BillServiceClient iGstSvc = new Bill_Svc.BillServiceClient())
            {
                CustomerInfo obj = iGstSvc.GetDetails_Customer("S", CustomerID, "", OrganizationCode, false, "", "");

                ViewBag.Organizations = CommonMethods.ListOrganizations(obj.OrganizationCode);

                ViewBag.Countries_Basic = CommonMethods.ListCountry(obj.Country);
                ViewBag.Countries_Ship  = CommonMethods.ListCountry(obj.Shipping_Country);
                ViewBag.Countries_Bill  = CommonMethods.ListCountry(obj.Billing_Country);

                ViewBag.State_Basic = CommonMethods.ListStates(obj.Country, obj.State);
                ViewBag.State_Ship  = CommonMethods.ListStates(obj.Shipping_Country, obj.Shipping_State);
                ViewBag.State_Bill  = CommonMethods.ListStates(obj.Billing_Country, obj.Billing_State);

                ListStaticValue_RegtypeDeliveryPaymentTitleSafix(obj.GSTRegistrationType, obj.PrefferedDeliveryMethod, obj.PrefferedPaymentMethod, obj.Title, obj.Safix);

                //Modified on [23th July 2019] by [Partha] cause [wrong view name] - Start
                return(PartialView("~/Views/MasterPages/SupplierDetails.cshtml", obj));
                //Modified on [23th July 2019] by [Partha] cause [wrong view name] - End
            }
        }
        public ActionResult GetList_Supplier()
        {
            string OrganizationCode = "";

            if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
            {
                OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim();
            }

            using (Bill_Svc.BillServiceClient iGstSvc = new Bill_Svc.BillServiceClient())
            {
                return(View("~/Views/MasterPages/SupplierList.cshtml", iGstSvc.GetList_Customer("S", "", "", OrganizationCode, false, "", "")));
            }
        }
Exemplo n.º 4
0
        public ActionResult GetList_Bill()
        {
            string OrganizationCode = "";

            if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
            {
                OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim();
            }

            using (Bill_Svc.BillServiceClient iGstSvc = new Bill_Svc.BillServiceClient())
            {
                ViewBag.Organizations = CommonMethods.ListOrganizations(OrganizationCode);
                return(View("~/Views/MasterPages/BillList.cshtml", iGstSvc.GetList_Bill("", "", "", OrganizationCode, "", "", "", "")));
            }
        }
Exemplo n.º 5
0
        public static string ListCustomer(string SelectedOrganization, string SelectedCustomer)
        {
            List <CustomerInfo> Customers = null;

            System.Text.StringBuilder sbCustomerList = new System.Text.StringBuilder();

            try
            {
                if (System.Web.HttpContext.Current.Session["UserDetails"] != null && ((UserInfo)System.Web.HttpContext.Current.Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)System.Web.HttpContext.Current.Session["UserDetails"]).OrganizationCode != null)
                {
                    SelectedOrganization = ((UserInfo)System.Web.HttpContext.Current.Session["UserDetails"]).OrganizationCode.Trim();
                }

                if (System.Web.HttpContext.Current.Session["Customers"] == null)
                {
                    Customers = new Bill_Svc.BillServiceClient().GetList_Customer("C", SelectedCustomer, "", SelectedOrganization, false, "", "");
                    System.Web.HttpContext.Current.Session["Customers"] = Customers;
                }
                else
                {
                    Customers = (List <CustomerInfo>)System.Web.HttpContext.Current.Session["Customers"];
                }
            }
            catch (Exception ex)
            {
                ErrorLog.LogErrors_Comments(ex.Message + ex.InnerException + ex.StackTrace, "Controler", "Organization ist", "");
                Customers = new List <CustomerInfo>();
            }

            sbCustomerList.AppendLine("<option value=\"\">Select one</option>");

            if (Customers != null && Customers.Count > 0)
            {
                foreach (CustomerInfo country in Customers)
                {
                    if (!string.IsNullOrEmpty(SelectedCustomer) && country.CusID.Trim() == SelectedCustomer.Trim())
                    {
                        sbCustomerList.AppendLine("<option value=\"" + country.CusID + "\" selected=\"selected\">" + (country.First_Name + " " + country.Last_Name) + "</option>");
                    }
                    else
                    {
                        sbCustomerList.AppendLine("<option value=\"" + country.CusID + "\">" + (country.First_Name + " " + country.Last_Name) + "</option>");
                    }
                }
            }

            return(sbCustomerList.ToString());
        }
Exemplo n.º 6
0
        public ActionResult GetList_CustomerImage(string ImageId, string CustomerID, string IsActive, string IsMain)
        {
            using (Bill_Svc.BillServiceClient iGstSvc = new Bill_Svc.BillServiceClient())
            {
                List <CustomerImageInfo> list = iGstSvc.GetList_CustomerImage(ImageId, CustomerID, "", IsMain);

                if (list != null && list.Count > 0 && list[0].ImageId > 0)
                {
                    return(Json(list, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json("NO", JsonRequestBehavior.AllowGet));
                }
            }
        }
Exemplo n.º 7
0
        public ActionResult GetDetails_Bill(string InvoiceID, string BranchID, string CusID, string org, string InvoiceDateFrom, string InvoiceDateTo, string IsReturned, string IsCancelled)
        {
            if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
            {
                org = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim();
            }

            using (Bill_Svc.BillServiceClient iGstSvc = new Bill_Svc.BillServiceClient())
            {
                InvoiceInfo obj = iGstSvc.GetDetails_Bill(InvoiceID, BranchID, CusID, org, InvoiceDateFrom, InvoiceDateTo, IsReturned, IsCancelled);
                ViewBag.Customers = CommonMethods.ListCustomer(org, obj.CusID);

                ViewBag.Organizations = CommonMethods.ListOrganizations(org);
                ViewBag.Currencies    = CommonMethods.ListApplicableCurrencies(obj.ChangedCurrency);

                return(PartialView("~/Views/MasterPages/BillDetails.cshtml", obj));
            }
        }
Exemplo n.º 8
0
        public ActionResult GetList_CustomerForDropdownlist(string UserType)
        {
            if (Session["CustomerList"] == null)
            {
                string OrganizationCode = "";
                if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
                {
                    OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim();
                }

                using (Bill_Svc.BillServiceClient iGstSvc = new Bill_Svc.BillServiceClient())
                {
                    List <CustomerInfo> list = iGstSvc.GetList_Customer(UserType.Trim().ToUpper(), "", "", OrganizationCode, false, "", "");
                    return(Json(list, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                return(Json((List <CustomerInfo>)Session["CustomerList"], JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 9
0
        public ActionResult Save_Bill(string isOnlyDelete, string OrganizationCode, string BillId, string CusID, string BranchID, string BillDate, string DueDate, string ShipAddress, string ShipCity, string ShipCountry, string ShipState, string xmlstring, string ChangedCurrency, string ConversionRate, string PrevConversionRate, string IsReturned, string Iscancelled, string PaidAmount, string DueAmount, string SumAmount)
        {
            if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
            {
                OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim();
            }

            using (Bill_Svc.BillServiceClient iGstSvc = new Bill_Svc.BillServiceClient())
            {
                InvoiceInfo objBill = new InvoiceInfo();

                objBill.InvoiceID       = BillId;
                objBill.BranchID        = BranchID;
                objBill.CusID           = CusID;
                objBill.ShipAddress     = ShipAddress;
                objBill.ShipCity        = ShipCity;
                objBill.ShipState       = ShipState;
                objBill.ShipCountry     = ShipCountry;
                objBill.ProductIDs      = xmlstring;
                objBill.ChangedCurrency = ChangedCurrency;
                objBill.ConversionRate  = ConversionRate;
                objBill.IsReturned      = IsReturned.Trim().ToUpper() == "Y";
                objBill.IsCancelled     = Iscancelled.Trim().ToUpper() == "Y";

                objBill.AmountPayable      = PaidAmount;
                objBill.AmountDue          = DueAmount;
                objBill.PrevConversionRate = PrevConversionRate;
                objBill.SumAmount          = SumAmount;
                objBill.OrganizationCode   = OrganizationCode;

                if (iGstSvc.Save_Bill(isOnlyDelete.Trim().ToUpper() == "Y", objBill, ((UserInfo)Session["UserDetails"]).UserCode, out ErrorMessage))
                {
                    return(Json("Ok", JsonRequestBehavior.AllowGet));
                }
            }

            return(Json(ErrorMessage, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 10
0
        public ActionResult Save_CustomerImageList(string isOnlyDelete, string ImageId, string CustomerId, string IsMain, string IsActive, HttpPostedFileBase[] files)
        {
            string fileName = "", path = "";

            using (Bill_Svc.BillServiceClient iGstSvc = new Bill_Svc.BillServiceClient())
            {
                CustomerImageInfo objCustomerImage = null;

                if (files == null && isOnlyDelete.Trim().ToUpper() == "Y")
                {
                    objCustomerImage = new CustomerImageInfo();

                    objCustomerImage.CustomerId = CustomerId.Trim().Length == 0 ? 0 : Convert.ToInt32(CustomerId);
                    objCustomerImage.ImageId    = ImageId.Trim().Length == 0 ? 0 : Convert.ToInt32(ImageId);
                    objCustomerImage.IsActive   = IsActive.Trim().ToUpper();
                    objCustomerImage.Ismain     = IsMain.Trim().ToUpper();
                    objCustomerImage.IsActive   = IsActive.Trim().ToUpper();

                    if (iGstSvc.Save_CustomerImage(isOnlyDelete.Trim().ToUpper() == "Y", objCustomerImage, ((UserInfo)Session["UserDetails"]).UserCode, out ErrorMessage))
                    {
                        //If delete success then file should be deleted
                        if (isOnlyDelete.Trim().ToUpper() == "Y")
                        {
                            try
                            {
                                if (System.IO.File.Exists(path))
                                {
                                    System.IO.File.Delete(path);
                                }
                            }
                            catch (Exception ex) { ErrorMessage = ErrorMessage + ex.Message; }
                        }

                        return(Json("Ok", JsonRequestBehavior.AllowGet));
                    }
                }
                if (files != null)
                {
                    foreach (HttpPostedFileBase file in files)
                    {
                        objCustomerImage = new CustomerImageInfo();

                        if (ImageId.Trim().Replace("0", "").Length == 0)
                        {
                            fileName = Guid.NewGuid().ToString() + System.IO.Path.GetExtension(file.FileName);
                            path     = System.IO.Path.Combine(Server.MapPath(System.Configuration.ConfigurationManager.AppSettings["UploadDataPath"].ToString()), fileName);
                            file.SaveAs(path);
                            objCustomerImage.FileName = fileName;
                            objCustomerImage.FileType = file.ContentType;
                        }


                        objCustomerImage.CustomerId = Convert.ToInt32(CustomerId);
                        objCustomerImage.ImageId    = ImageId.Trim().Length == 0 ? 0 : Convert.ToInt32(ImageId);
                        objCustomerImage.IsActive   = IsActive.Trim().ToUpper();
                        objCustomerImage.Ismain     = IsMain.Trim().ToUpper();
                        objCustomerImage.IsActive   = IsActive.Trim().ToUpper();

                        if (iGstSvc.Save_CustomerImage(isOnlyDelete.Trim().ToUpper() == "Y", objCustomerImage, ((UserInfo)Session["UserDetails"]).UserCode, out ErrorMessage))
                        {
                            //If delete success then file should be deleted
                            if (isOnlyDelete.Trim().ToUpper() == "Y")
                            {
                                try
                                {
                                    if (System.IO.File.Exists(path))
                                    {
                                        System.IO.File.Delete(path);
                                    }
                                }
                                catch (Exception ex) { ErrorMessage = ErrorMessage + ex.Message; }

                                if (ErrorMessage.Trim().Length > 0 && ImageId.Trim().Replace("0", "").Length == 0)
                                {
                                    try
                                    {
                                        if (System.IO.File.Exists(path))
                                        {
                                            System.IO.File.Delete(path);
                                        }
                                    }
                                    catch (Exception ex) { ErrorMessage = ErrorMessage + ex.Message; }
                                }

                                return(Json(ErrorMessage, JsonRequestBehavior.AllowGet));
                            }
                        }
                    }

                    return(Json("Ok", JsonRequestBehavior.AllowGet));
                }
            }

            return(Json(ErrorMessage, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 11
0
        public ActionResult Save_Customer(string UserType, string isDelete, string CusID,
                                          string Title, string First_Name, string Middle_Name, string Last_Name, string DOB, string Sex, string Safix, string ParentCusID, string BillingWith, string IsActive, string OrganizationCode,
                                          string EmailID, string Mobile, string Street1, string Street2, string City, string State, string Country, string Website,
                                          string GSTRegistrationType, string GSTIN, string IsSubCustomer, string TaxRegNo, string CSTRegNo, string PANNo, string Terms,
                                          string PrefferedPaymentMethod, string PrefferedDeliveryMethod,
                                          string Shipping_Street1, string Shipping_Street2, string Shipping_City, string Shipping_State, string Shipping_Country,
                                          string Billing_Street1, string Billing_Street2, string Billing_City, string Billing_State, string Billing_Country,
                                          string OpeningBalance, string AsOfDate,
                                          string Notes)
        {
            if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
            {
                OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim();
            }

            using (Bill_Svc.BillServiceClient iGstSvc = new Bill_Svc.BillServiceClient())
            {
                CustomerInfo objCustomerInfo = new CustomerInfo();
                objCustomerInfo.CusID                   = CusID;
                objCustomerInfo.Title                   = Title;
                objCustomerInfo.First_Name              = First_Name;
                objCustomerInfo.Middle_Name             = Middle_Name;
                objCustomerInfo.Last_Name               = Last_Name;
                objCustomerInfo.DOB                     = DOB;
                objCustomerInfo.Sex                     = Sex;
                objCustomerInfo.Safix                   = Safix;
                objCustomerInfo.ParentCusID             = ParentCusID;
                objCustomerInfo.BillingWith             = BillingWith;
                objCustomerInfo.IsActive                = IsActive == "Y";
                objCustomerInfo.OrganizationCode        = OrganizationCode;
                objCustomerInfo.EmailID                 = EmailID;
                objCustomerInfo.Mobile                  = Mobile;
                objCustomerInfo.Street1                 = Street1;
                objCustomerInfo.Street2                 = Street2;
                objCustomerInfo.City                    = City;
                objCustomerInfo.State                   = State;
                objCustomerInfo.Country                 = Country;
                objCustomerInfo.Website                 = Website;
                objCustomerInfo.GSTRegistrationType     = GSTRegistrationType;
                objCustomerInfo.GSTIN                   = GSTIN;
                objCustomerInfo.IsSubCustomer           = IsSubCustomer == "Y";
                objCustomerInfo.TaxRegNo                = TaxRegNo;
                objCustomerInfo.CSTRegNo                = CSTRegNo;
                objCustomerInfo.PANNo                   = PANNo;
                objCustomerInfo.Terms                   = Terms;
                objCustomerInfo.PrefferedPaymentMethod  = PrefferedPaymentMethod;
                objCustomerInfo.PrefferedDeliveryMethod = PrefferedDeliveryMethod;
                objCustomerInfo.Shipping_Street1        = Shipping_Street1;
                objCustomerInfo.Shipping_Street2        = Shipping_Street2;
                objCustomerInfo.Shipping_City           = Shipping_City;
                objCustomerInfo.Shipping_State          = Shipping_State;
                objCustomerInfo.Shipping_Country        = Shipping_Country;
                objCustomerInfo.Billing_Street1         = Billing_Street1;
                objCustomerInfo.Billing_Street2         = Billing_Street2;
                objCustomerInfo.Billing_City            = Billing_City;
                objCustomerInfo.Billing_State           = Billing_State;
                objCustomerInfo.Billing_Country         = Billing_Country;
                objCustomerInfo.OpeningBalance          = OpeningBalance;
                objCustomerInfo.AsOfDate                = AsOfDate;
                objCustomerInfo.Notes                   = Notes;

                if (iGstSvc.Save_Customer(UserType.Trim().ToUpper(), isDelete == "Y", objCustomerInfo, ((UserInfo)Session["UserDetails"]).UserCode, out ErrorMessage))
                {
                    return(Json("Ok", JsonRequestBehavior.AllowGet));
                }
            }

            return(Json(ErrorMessage, JsonRequestBehavior.AllowGet));
        }