Ejemplo n.º 1
0
        public static String GruzobozCostLoweringPercentage(String money)
        {
            if (String.IsNullOrEmpty(money) || money == " ")
            {
                return(money);
            }
            var notRoundResult = (Convert.ToDecimal(money) * (100 - Convert.ToDecimal(BackendHelper.TagToValue("gruzoboz_cost_lowering_ percentage")))) / 100;

            notRoundResult = MoneyMethods.MoneyRounder10000(notRoundResult);
            return(notRoundResult.ToString());
        }
Ejemplo n.º 2
0
        public static string OldNewValueToRuss(string tableName, string propertyName, string value)
        {
            #region таблица заявок
            if (tableName == "tickets")
            {
                if (propertyName == "CourseRUR" ||
                    propertyName == "CourseUSD" ||
                    propertyName == "CourseEUR" ||
                    propertyName == "DeliveryCost" ||
                    propertyName == "AssessedCost" ||
                    propertyName == "AgreedCost" ||
                    propertyName == "ReceivedUSD" ||
                    propertyName == "ReceivedEUR" ||
                    propertyName == "ReceivedEUR" ||
                    propertyName == "ReceivedBLR" ||
                    propertyName == "GruzobozCost")
                {
                    return(MoneyMethods.MoneySeparator(value));
                }

                if (propertyName == "DriverID")
                {
                    return(DriversHelper.DriverIDToFioToPrint(value));
                }

                if (propertyName == "StatusIDOld" || propertyName == "StatusID")
                {
                    return(OtherMethods.TicketStatusToText(value));
                }

                if (propertyName == "CityID")
                {
                    return(CityHelper.CityIDToCityNameWithotCustom(value));
                }

                if (propertyName == "TrackIDUser")
                {
                    return(OtherMethods.TrackToText(Convert.ToInt32(value)));
                }

                if (propertyName == "DeliveryDate")
                {
                    return(value.Remove(value.Length - 8));
                }

                if (propertyName == "Comment")
                {
                    return(WebUtility.HtmlDecode(value));
                }

                if (propertyName == "PrintNakl" ||
                    propertyName == "PrintNaklInMap" ||
                    propertyName == "IsExchange" ||
                    propertyName == "WithoutMoney" ||
                    propertyName == "CheckedOut" ||
                    propertyName == "Phoned")
                {
                    return(value == "0" ? "нет" : "да");
                }

                if (propertyName == "OvDateFrom" || propertyName == "OvDateTo")
                {
                    return(String.IsNullOrEmpty(value) ? String.Empty : Convert.ToDateTime(value).ToString("HH:mm"));
                }
            }
            #endregion

            #region таблица пользователей
            if (tableName == "users")
            {
                if (propertyName == "SpecialClient" || propertyName == "IsCourse" || propertyName == "AllowApi")
                {
                    return(value == "0" ? "нет" : "да");
                }

                if (propertyName == "Status")
                {
                    return(UsersHelper.UserStatusToText(Convert.ToInt32(value)));
                }

                if (propertyName == "Role")
                {
                    return(UsersHelper.RoleToRuss(value));
                }

                if (propertyName == "Discount")
                {
                    return(String.Format("{0}%", value));
                }

                if (propertyName == "Password")
                {
                    return(String.Empty);
                }

                if (propertyName == "Validity" && value.Length >= 8)
                {
                    return(value.Remove(value.Length - 8));
                }

                if (propertyName == "BirthDay" && value.Length >= 8)
                {
                    return(value.Remove(value.Length - 8));
                }

                if (propertyName == "DateOfIssue" && value.Length >= 8)
                {
                    return(value.Remove(value.Length - 8));
                }
            }
            #endregion

            #region таблица грузов
            if (tableName == "goods")
            {
                if (propertyName == "Cost")
                {
                    return(MoneyMethods.MoneySeparator(value));
                }

                if (propertyName == "WithoutAkciza")
                {
                    return(value == "0" ? "нет" : "да");
                }
            }
            #endregion

            #region таблица профилей
            if (tableName == "usersprofiles")
            {
                if (propertyName == "StatusID")
                {
                    return(UsersProfilesHelper.UserProfileStatusToText(Convert.ToInt32(value)));
                }
            }
            #endregion

            #region таблица водителй
            if (tableName == "drivers")
            {
                if (propertyName == "StatusID" && !String.IsNullOrEmpty(value))
                {
                    return(DriversHelper.DriverStatusToText(Convert.ToInt32(value)));
                }

                if (value.Length >= 8 && (propertyName == "DateOfIssue" ||
                                          propertyName == "Validity" ||
                                          propertyName == "BirthDay" ||
                                          propertyName == "DriverPassportDateOfIssue" ||
                                          propertyName == "DriverPassportValidity" ||
                                          propertyName == "MedPolisDateOfIssue" ||
                                          propertyName == "MedPolisValidity"))
                {
                    return(value.Remove(value.Length - 8));
                }
            }
            #endregion

            #region таблица авто
            if (tableName == "cars")
            {
                if (propertyName == "TypeID" && !String.IsNullOrEmpty(value))
                {
                    return(CarsHelper.CarTypeToFullString(Convert.ToInt32(value)));
                }
            }
            #endregion

            #region таблица категорий
            if (tableName == "category")
            {
                if (propertyName == "Name")
                {
                    return(value);
                }
            }
            #endregion

            return(value);
        }