Example #1
0
        public static List <VehicleMasterVM> GetVehicleMaster(VehicleMasterVM o)
        {
            o = o ?? new VehicleMasterVM();
            Dictionary <string, string> input = new Dictionary <string, string>()
            {
                { "VehicleID", o.VehicleID ?? "" },
                { "VehicleDescription", o.VehicleDescription ?? "" },
                { "RegistrationNo", o.RegistrationNo ?? "" },
                { "Model", o.Model ?? "" },
                { "PurchaseValue", o.PurchaseValue ?? "" },
                { "PurchaseDate", o.PurchaseDate ?? "" },
                { "RegExpirydate", o.RegExpirydate ?? "" },
                { "VehicleTypeID", o.VehicleTypeID ?? "" },
                { "InsuranceExpDate", o.InsuranceExpDate ?? "" },
                { "AcCompanyID", o.AcCompanyID ?? "" },
                { "Mode", o.Mode ?? "" },
                { "FinanceCompany", o.FinanceCompany ?? "" },
                { "InsuranceCompName", o.InsuranceCompName ?? "" },
                { "PolicyNo", o.PolicyNo ?? "" },
                { "InsuredValue", o.InsuredValue ?? "" },
                { "Category", o.Category ?? "" },
                { "DepreciationDate", o.DepreciationDate ?? "" },
                { "ScrapValue", o.ScrapValue ?? "" },
                { "BranchID", o.BranchID ?? "" },
                { "MakeYear", o.MakeYear ?? "" },
                { "RegisteredUnder", o.RegisteredUnder ?? "" },
                { "TDDate", o.TDDate ?? "" },
                { "RouteID", o.RouteID ?? "" },
                { "eMode", o.eMode ?? "" },
            };

            return(pgFun.GetData <VehicleMasterVM>("[dbo].[usp_VehicleMaster_Get]", input));
        }
Example #2
0
        public static string ManageVehicleMaster(VehicleMasterVM o)
        {
            o = o ?? new VehicleMasterVM();
            string Res = "Error";

            try
            {
                Dictionary <string, string> input = new Dictionary <string, string>()
                {
                    { "VehicleID", o.VehicleID ?? "" },
                    { "VehicleDescription", o.VehicleDescription ?? "" },
                    { "RegistrationNo", o.RegistrationNo ?? "" },
                    { "Model", o.Model ?? "" },
                    { "PurchaseValue", o.PurchaseValue ?? "" },
                    { "PurchaseDate", o.PurchaseDate ?? "" },
                    { "RegExpirydate", o.RegExpirydate ?? "" },
                    { "VehicleTypeID", o.VehicleTypeID ?? "" },
                    { "InsuranceExpDate", o.InsuranceExpDate ?? "" },
                    { "AcCompanyID", o.AcCompanyID ?? "" },
                    { "Mode", o.Mode ?? "" },
                    { "FinanceCompany", o.FinanceCompany ?? "" },
                    { "InsuranceCompName", o.InsuranceCompName ?? "" },
                    { "PolicyNo", o.PolicyNo ?? "" },
                    { "InsuredValue", o.InsuredValue ?? "" },
                    { "Category", o.Category ?? "" },
                    { "DepreciationDate", o.DepreciationDate ?? "" },
                    { "ScrapValue", o.ScrapValue ?? "" },
                    { "BranchID", o.BranchID ?? "" },
                    { "MakeYear", o.MakeYear ?? "" },
                    { "RegisteredUnder", o.RegisteredUnder ?? "" },
                    { "eMode", o.eMode ?? "" },
                };
                Dictionary <string, string> output = new Dictionary <string, string>()
                {
                    { "Result", "" }
                };
                Dictionary <string, string> res = pgFun.ExecuteSQL("[dbo].[usp_VehicleMaster_Manage]", input, output, true);
                int  LastID = 0;
                bool isdone = int.TryParse(res["Result"], out LastID);
                if (isdone)
                {
                    Res = res["Result"];
                }
                else
                {
                    Res = res["Result"];
                }
                return(Res);
            }
            catch (Exception p)
            {
                return(p.Message);
            }
        }