コード例 #1
0
        public ActionResult Save_ExpenseOrganization(string isOnlyDelete, string OrganizationproductId, string ProductId, string CategoryId, string CountryId, string OrganizationCode, string IsActive,
                                                     string Name, string Description, string SKU, string Unit, string Class, string AbatementPercentage, string ServiceType,
                                                     string SalePrice, string isInclusiveTax, string AvailableQty, string IncomeAccount, string SupplierId,
                                                     string PreferredSupplierId, string ReverseCharge, string PurchaseTax, string SaleTax)
        {
            if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
            {
                OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim();
            }

            using (Expense_Svc.ExpenseServiceClient iGstSvc = new Expense_Svc.ExpenseServiceClient())
            {
                // Modified on [3rd August 2019] by [Partha] cause [Giving NULL reference exception
                // when Organisation Code is null] - Start
                if (OrganizationproductId == null)
                {
                    OrganizationproductId = "";
                }
                // End: Modified on [3rd August 2019]
                ProductOrganiztionInfo objProduct = new ProductOrganiztionInfo();
                objProduct.OrganizationproductId = OrganizationproductId.Trim().Length == 0 ? 0 : Convert.ToInt32(OrganizationproductId.Trim());
                objProduct.ProductId             = ProductId;
                objProduct.CategoryId            = CategoryId;
                objProduct.CountryId             = CountryId;
                objProduct.OrganizationCode      = OrganizationCode;
                objProduct.IsActive = IsActive.Trim().ToUpper();

                objProduct.Name                = Name;
                objProduct.Description         = Description;
                objProduct.ServiceType         = ServiceType.Trim().Length > 0 ? Convert.ToInt32(ServiceType) : 0;
                objProduct.SKU                 = SKU;
                objProduct.Unit                = Unit.Trim().Length == 0 ? 0 : Convert.ToInt32(Unit);
                objProduct.Class               = Class.Trim().Length == 0 ? 0 : Convert.ToInt32(Class);
                objProduct.AbatementPercentage = AbatementPercentage.Trim().Length == 0 ? 0 : Convert.ToInt32(AbatementPercentage);
                objProduct.SalePrice           = SalePrice.Trim().Length == 0 ? 0 : Convert.ToInt32(SalePrice);
                objProduct.isInclusiveTax      = isInclusiveTax.Trim().ToUpper() == "Y";
                objProduct.AvailableQty        = AvailableQty.Trim().Length == 0 ? 0 : Convert.ToInt32(AvailableQty);
                objProduct.IncomeAccount       = IncomeAccount;
                objProduct.SupplierId          = SupplierId.Trim().Length == 0 ? 0 : Convert.ToInt32(SupplierId);
                objProduct.PreferredSupplierId = PreferredSupplierId.Trim().Length == 0 ? 0 : Convert.ToInt32(PreferredSupplierId);
                objProduct.ReverseCharge       = ReverseCharge.Trim().Length == 0 ? 0 : Convert.ToInt32(ReverseCharge);
                objProduct.PurchaseTax         = PurchaseTax.Trim().Length == 0 ? 0 : Convert.ToInt32(PurchaseTax);
                objProduct.SaleTax             = SaleTax.Trim().Length == 0 ? 0 : Convert.ToInt32(SaleTax);


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

            return(Json(ErrorMessage, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public static List <ProductOrganiztionInfo> GetList_ProductOrganization(string OrganizationproductId, string ProductID, string ProductName, string OrganizationCode, string CountryId, bool IsActive, string LanguageId)
        {
            List <DBHelper.Parameter> ParamList = new List <DBHelper.Parameter>();

            ParamList.Add(new DBHelper.Parameter("@Mode", 0));
            ParamList.Add(new DBHelper.Parameter("@OrganizationproductId", OrganizationproductId.Trim().Length > 0 ? Convert.ToInt32(OrganizationproductId) : 0));
            ParamList.Add(new DBHelper.Parameter("@ProductId", ProductID.Trim().Length > 0 ? Convert.ToInt32(ProductID) : 0));
            ParamList.Add(new DBHelper.Parameter("@OrganizationCode", OrganizationCode));
            ParamList.Add(new DBHelper.Parameter("@CountryId", CountryId.Trim().Length > 0 ? Convert.ToInt32(CountryId) : 0));
            ParamList.Add(new DBHelper.Parameter("@LanguageId", LanguageId.Trim().Length > 0 ? Convert.ToInt32(LanguageId) : 0));
            // Modified on [30th August 2019] by [Partha] cause [Adding isExpense parameter]
            //DBHelper.AddPparameter("@isExpense", isExpense);
            // Modified on [30th August 2019] by [Partha]

            using (DBHelper dbhlper = new DBHelper())
            {
                using (DataSet ds = dbhlper.ExecuteQuery("spMAPOrganizationproductGetList", ParamList))
                {
                    if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                    {
                        List <ProductOrganiztionInfo> list = new List <ProductOrganiztionInfo>();
                        ProductOrganiztionInfo        obj  = null;

                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            obj = new ProductOrganiztionInfo();
                            obj.OrganizationproductId = dr["OrganizationproductId"] == DBNull.Value ? 0 : Convert.ToInt32(dr["OrganizationproductId"]);
                            obj.ProductId             = dr["ProductID"].ToString();
                            obj.ProductName           = dr["ProductName"].ToString();
                            obj.CategoryId            = dr["CategoryId"].ToString();
                            obj.CategoryName          = dr["CategoryName"].ToString();
                            obj.CountryName           = dr["CountryName"].ToString();
                            obj.OrganizationCode      = dr["OrganizationCode"].ToString();
                            // Modified on [24th August 2019] by [Partha] cause [show OrganizationName in List] - Start
                            obj.OrganizationName = dr["OrganizationName"].ToString();
                            // Modified on [24th August 2019] by [Partha] - End
                            obj.ServiceOrGoods = dr["ServiceOrGoods"].ToString();
                            obj.HSNSACCode     = dr["HSNSACCode"].ToString();
                            obj.Name           = dr["name"].ToString();

                            list.Add(obj);
                        }

                        return(list);
                    }
                }
            }

            var list1 = new List <ProductOrganiztionInfo>();

            list1.Add(new ProductOrganiztionInfo());
            return(list1);
        }
コード例 #3
0
 public bool Save_ExpenseOrganization(bool isOnlyDelete, ProductOrganiztionInfo obj, UserInfo objUserInfo, out string errormsg)
 {
     return(wsExpense.Save_ExpenseOrganization(isOnlyDelete, obj, objUserInfo, out errormsg));
 }
コード例 #4
0
        public static List <ProductOrganiztionInfo> GetDetails_ExpenseOrganization(string OrganizationproductId, string ProductID, string ProductName, string OrganizationCode, string CountryId, bool IsActive, string LanguageId)
        {
            using (DBHelper dbhlper = new DBHelper("[spMAPOrganizationExpenseGet]"))
            {
                DBHelper.AddPparameter("@Mode", 1);
                DBHelper.AddPparameter("@OrganizationproductId", OrganizationproductId.Trim().Length > 0 ? Convert.ToInt32(OrganizationproductId) : 0);
                DBHelper.AddPparameter("@ProductId", ProductID.Trim().Length > 0 ? Convert.ToInt32(ProductID) : 0);
                DBHelper.AddPparameter("@OrganizationCode", OrganizationCode);
                DBHelper.AddPparameter("@CountryId", CountryId.Trim().Length > 0 ? Convert.ToInt32(CountryId) : 0);
                DBHelper.AddPparameter("@LanguageId", LanguageId.Trim().Length > 0 ? Convert.ToInt32(LanguageId) : 0);

                using (DataSet ds = DBHelper.Execute_Query())
                {
                    if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                    {
                        List <ProductOrganiztionInfo> list = new List <ProductOrganiztionInfo>();
                        ProductOrganiztionInfo        obj  = null;

                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            obj = new ProductOrganiztionInfo();
                            obj.OrganizationproductId = dr["OrganizationproductId"] == DBNull.Value ? 0 : Convert.ToInt32(dr["OrganizationproductId"]);
                            obj.ProductId             = dr["ProductID"].ToString();
                            //obj.OrganizationName = dr["OrganizationName"].ToString();
                            obj.ProductName         = dr["ProductName"].ToString();
                            obj.CategoryId          = dr["CategoryId"].ToString();
                            obj.CategoryName        = dr["CategoryName"].ToString();
                            obj.ServiceOrGoods      = dr["ServiceOrGoods"].ToString();
                            obj.HSNSACCode          = dr["HSNSACCode"].ToString();
                            obj.Name                = dr["name"].ToString();
                            obj.Description         = dr["Description"].ToString();
                            obj.SKU                 = dr["SKU"].ToString();
                            obj.Unit                = dr["Unit"] == DBNull.Value ? 0 : Convert.ToInt32(dr["Unit"]);
                            obj.Class               = dr["Class"] == DBNull.Value ? 0 : Convert.ToInt32(dr["Class"]);
                            obj.AbatementPercentage = dr["AbatementPercentage"] == DBNull.Value ? 0 : Convert.ToInt32(dr["AbatementPercentage"]);
                            obj.ServiceType         = dr["ServiceType"] == DBNull.Value ? 0 : Convert.ToInt32(dr["ServiceType"]);
                            obj.SalePrice           = dr["SalePrice"] == DBNull.Value ? 0 : Convert.ToInt32(dr["SalePrice"]);
                            obj.isInclusiveTax      = dr["isInclusiveTax"].ToString().Trim().ToUpper() == "Y";
                            obj.AvailableQty        = dr["AvailableQty"] == DBNull.Value ? 0 : Convert.ToInt32(dr["AvailableQty"]);
                            obj.IncomeAccount       = dr["IncomeAccount"].ToString();
                            obj.SupplierId          = dr["SupplierId"] == DBNull.Value ? 0 : Convert.ToInt32(dr["SupplierId"]);
                            obj.PreferredSupplierId = dr["PreferredSupplierId"] == DBNull.Value ? 0 : Convert.ToInt32(dr["PreferredSupplierId"]);
                            obj.ReverseCharge       = dr["ReverseCharge"] == DBNull.Value ? 0 : Convert.ToInt32(dr["ReverseCharge"]);
                            obj.PurchaseTax         = dr["PurchaseTax"] == DBNull.Value ? 0 : Convert.ToInt32(dr["PurchaseTax"]);
                            obj.SaleTax             = dr["SaleTax"] == DBNull.Value ? 0 : Convert.ToInt32(dr["SaleTax"]);
                            obj.isSelected          = dr["isExist"].ToString().Trim().ToUpper() == "Y";
                            obj.FileData            = dr["FileData"] == DBNull.Value ? null : (Byte[])dr["FileData"];
                            obj.FileName            = dr["FileName"].ToString();
                            obj.FileType            = dr["FileType"].ToString();
                            obj.ImageId             = dr["ImageId"].ToString();

                            list.Add(obj);
                        }

                        return(list);
                    }
                }
            }

            return(null);
        }
コード例 #5
0
        public static List <ProductOrganiztionInfo> GetList_ExpenseOrganization(string OrganizationproductId, string ProductID, string ProductName, string OrganizationCode, string CountryId, bool IsActive, string LanguageId)
        {
            using (DBHelper dbhlper = new DBHelper("[spMAPOrganizationExpenseGet]"))
            {
                DBHelper.AddPparameter("@Mode", 0);
                DBHelper.AddPparameter("@OrganizationproductId", OrganizationproductId.Trim().Length > 0 ? Convert.ToInt32(OrganizationproductId) : 0);
                DBHelper.AddPparameter("@ProductId", ProductID.Trim().Length > 0 ? Convert.ToInt32(ProductID) : 0);
                DBHelper.AddPparameter("@OrganizationCode", OrganizationCode);
                DBHelper.AddPparameter("@CountryId", CountryId.Trim().Length > 0 ? Convert.ToInt32(CountryId) : 0);
                DBHelper.AddPparameter("@LanguageId", LanguageId.Trim().Length > 0 ? Convert.ToInt32(LanguageId) : 0);
                // Modified on [30th August 2019] by [Partha] cause [Adding isExpense parameter]
                //DBHelper.AddPparameter("@isExpense", "E");
                // Modified on [30th August 2019] by [Partha]
                using (DataSet ds = DBHelper.Execute_Query())
                {
                    if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                    {
                        List <ProductOrganiztionInfo> list = new List <ProductOrganiztionInfo>();
                        ProductOrganiztionInfo        obj  = null;

                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            obj = new ProductOrganiztionInfo();
                            obj.OrganizationproductId = dr["OrganizationproductId"] == DBNull.Value ? 0 : Convert.ToInt32(dr["OrganizationproductId"]);
                            obj.ProductId             = dr["ProductID"].ToString();
                            obj.ProductName           = dr["ProductName"].ToString();
                            obj.CategoryId            = dr["CategoryId"].ToString();
                            obj.CategoryName          = dr["CategoryName"].ToString();
                            obj.CountryName           = dr["CountryName"].ToString();
                            obj.OrganizationCode      = dr["OrganizationCode"].ToString();
                            // Modified on [24th August 2019] by [Partha] cause [show OrganizationName in List] - Start
                            obj.OrganizationName = dr["OrganizationName"].ToString();
                            // Modified on [24th August 2019] by [Partha] - End
                            obj.ServiceOrGoods      = dr["ServiceOrGoods"].ToString();
                            obj.HSNSACCode          = dr["HSNSACCode"].ToString();
                            obj.Name                = dr["name"].ToString();
                            obj.Description         = dr["Description"].ToString();
                            obj.SKU                 = dr["SKU"].ToString();
                            obj.Unit                = dr["Unit"] == DBNull.Value ? 0 : Convert.ToInt32(dr["Unit"]);
                            obj.Class               = dr["Class"] == DBNull.Value ? 0 : Convert.ToInt32(dr["Class"]);
                            obj.AbatementPercentage = dr["AbatementPercentage"] == DBNull.Value ? 0 : Convert.ToInt32(dr["AbatementPercentage"]);
                            obj.ServiceType         = dr["ServiceType"] == DBNull.Value ? 0 : Convert.ToInt32(dr["ServiceType"]);
                            obj.SalePrice           = dr["SalePrice"] == DBNull.Value ? 0 : Convert.ToInt32(dr["SalePrice"]);
                            obj.isInclusiveTax      = dr["isInclusiveTax"].ToString().Trim().ToUpper() == "Y";
                            obj.AvailableQty        = dr["AvailableQty"] == DBNull.Value ? 0 : Convert.ToInt32(dr["AvailableQty"]);
                            obj.IncomeAccount       = dr["IncomeAccount"].ToString();
                            obj.SupplierId          = dr["SupplierId"] == DBNull.Value ? 0 : Convert.ToInt32(dr["SupplierId"]);
                            obj.PreferredSupplierId = dr["PreferredSupplierId"] == DBNull.Value ? 0 : Convert.ToInt32(dr["PreferredSupplierId"]);
                            obj.ReverseCharge       = dr["ReverseCharge"] == DBNull.Value ? 0 : Convert.ToInt32(dr["ReverseCharge"]);
                            obj.PurchaseTax         = dr["PurchaseTax"] == DBNull.Value ? 0 : Convert.ToInt32(dr["PurchaseTax"]);
                            obj.SaleTax             = dr["SaleTax"] == DBNull.Value ? 0 : Convert.ToInt32(dr["SaleTax"]);

                            list.Add(obj);
                        }

                        return(list);
                    }
                }
            }

            var list1 = new List <ProductOrganiztionInfo>();

            list1.Add(new ProductOrganiztionInfo());
            return(list1);
        }
コード例 #6
0
        public static bool Save_ExpenseOrganization(bool isOnlyDelete, ProductOrganiztionInfo obj, UserInfo objUserInfo, out string errormsg)
        {
            errormsg = "";
            bool flag = false;

            #region Validations
            if (!Validations.ValidateDataType(obj.OrganizationCode, Validations.ValueType.AlphaNumericSpecialChar, false, "Organization", out errormsg))
            {
                return(false);
            }
            if (!Validations.ValidateDataType(obj.ProductId, Validations.ValueType.Integer, true, "Product Info", out errormsg))
            {
                return(false);
            }
            if (!Validations.ValidateDataType(obj.CategoryId, Validations.ValueType.Integer, true, "Category Info", out errormsg))
            {
                return(false);
            }
            if (!Validations.ValidateDataType(obj.Name, Validations.ValueType.AlphaNumericSpecialChar, true, "Name", out errormsg))
            {
                return(false);
            }
            if (!Validations.ValidateDataType(obj.SKU, Validations.ValueType.AlphaNumericSpecialChar, true, "SKU", out errormsg))
            {
                return(false);
            }
            if (!Validations.ValidateDataType(obj.Description, Validations.ValueType.AlphaNumericSpecialChar, true, "Descripition", out errormsg))
            {
                return(false);
            }
            #endregion

            using (DBHelper dbhlper = new DBHelper("[spMAPOrganizationExpenseSave]", true))
            {
                DBHelper.AddPparameter("@OrganizationproductId", obj.OrganizationproductId, DBHelper.param_types.BigInt);
                DBHelper.AddPparameter("@CategoryId", obj.CategoryId.Trim().Length > 0 ? Convert.ToInt32(obj.CategoryId) : 0, DBHelper.param_types.BigInt);
                DBHelper.AddPparameter("@ProductId", obj.ProductId.Trim().Length > 0 ? Convert.ToInt32(obj.ProductId) : 0, DBHelper.param_types.BigInt);
                DBHelper.AddPparameter("@OrganizationCode", obj.OrganizationCode.Trim(), DBHelper.param_types.Varchar);
                DBHelper.AddPparameter("@Name", obj.Name, DBHelper.param_types.Varchar);
                DBHelper.AddPparameter("@Description", obj.Description, DBHelper.param_types.Varchar);
                DBHelper.AddPparameter("@SKU", obj.SKU, DBHelper.param_types.Varchar);
                DBHelper.AddPparameter("@Unit", obj.Unit, DBHelper.param_types.BigInt);
                DBHelper.AddPparameter("@Class", obj.Class, DBHelper.param_types.BigInt);
                DBHelper.AddPparameter("@AbatementPercentage", obj.AbatementPercentage, DBHelper.param_types.Numeric);
                DBHelper.AddPparameter("@ServiceType", obj.ServiceType, DBHelper.param_types.Numeric);
                DBHelper.AddPparameter("@SalePrice", obj.SalePrice, DBHelper.param_types.Numeric);
                DBHelper.AddPparameter("@isInclusiveTax", obj.isInclusiveTax ? "Y" : "N", DBHelper.param_types.Varchar);
                DBHelper.AddPparameter("@AvailableQty", obj.AvailableQty, DBHelper.param_types.Numeric);
                DBHelper.AddPparameter("@IncomeAccount", obj.IncomeAccount, DBHelper.param_types.Varchar);
                DBHelper.AddPparameter("@SupplierId", obj.SupplierId, DBHelper.param_types.BigInt);
                DBHelper.AddPparameter("@PreferredSupplierId", obj.PreferredSupplierId, DBHelper.param_types.Numeric);
                DBHelper.AddPparameter("@ReverseCharge", obj.ReverseCharge, DBHelper.param_types.Numeric);
                DBHelper.AddPparameter("@PurchaseTax", obj.PurchaseTax, DBHelper.param_types.Numeric);
                DBHelper.AddPparameter("@SaleTax", obj.SaleTax, DBHelper.param_types.Numeric);
                DBHelper.AddPparameter("@IsActive", obj.IsActive.Trim().ToUpper(), DBHelper.param_types.Varchar);
                DBHelper.AddPparameter("@UserCode", objUserInfo.UserCode.ToString().Trim(), DBHelper.param_types.Varchar);
                DBHelper.AddPparameter("@isOnlyDelete", (isOnlyDelete ? "Y" : "N"), DBHelper.param_types.Varchar);
                DBHelper.AddPparameter("@NewDatauniqueID", "", DBHelper.param_types.Varchar, 50, DBHelper.param_direction.Output);
                DBHelper.AddPparameter("@ErrorMessage", errormsg, DBHelper.param_types.Varchar, 500, DBHelper.param_direction.Output);

                return(DBHelper.Execute_NonQuery(out errormsg));
            }
        }