Exemplo n.º 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Code.Length != 0)
            {
                hash ^= Code.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Title.Length != 0)
            {
                hash ^= Title.GetHashCode();
            }
            if (Descript.Length != 0)
            {
                hash ^= Descript.GetHashCode();
            }
            if (NumberWord != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(NumberWord);
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 2
0
 public Order_refundSelectBuild WhereDescriptLike(params string[] Descript)
 {
     if (Descript == null || Descript.Where(a => !string.IsNullOrEmpty(a)).Any() == false)
     {
         return(this);
     }
     return(this.Where1Or(@"a.`descript` LIKE {0}", Descript.Select(a => "%" + a + "%").ToArray()));
 }
Exemplo n.º 3
0
        public ActionResult <Loan> AddDescripts(double balance, int years)
        {
            Loan.Descripts = new List <Descript>();
            var calc = new Calculate();

            for (int i = 1; i <= years; i++)
            {
                var descript = new Descript();
                descript.Year     = i;
                descript.Balance  = balance;
                descript.Interest = calc.InterestCalculate(Loan.rate, balance);
                descript.Payments = descript.Balance + descript.Interest;
                balance          += descript.Interest;

                Loan.Descripts.Add(descript);
            }

            return(Loan);
        }
Exemplo n.º 4
0
        protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
        {
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                using (SPSite sitecollection = new SPSite(Url))
                {
                    using (SPWeb web = sitecollection.OpenWeb())
                    {
                        SPList list           = web.Lists["Aufgaben"];
                        SPListItem listitem   = list.Items.Add();
                        SPContentType ConType = list.ContentTypes[ContentType.ToString()];

                        if (ConType != null)
                        {
                            listitem["ContentTypeId"] = ConType.Id;
                        }

                        if (!String.IsNullOrEmpty(Title) & listitem.Fields.ContainsField("Title"))
                        {
                            listitem["Title"] = Title.ToString();
                        }

                        if (!String.IsNullOrEmpty(Descript) & (listitem.Fields.ContainsField("Beschreibung") | listitem.Fields.ContainsField("Body")))
                        {
                            listitem["Beschreibung"] = Descript.ToString();
                        }

                        if (!String.IsNullOrEmpty(Link) & listitem.Fields.ContainsField("Link"))
                        {
                            LinkFieldValue lfValue = new LinkFieldValue();
                            lfValue.NavigateUrl    = Link.ToString();
                            lfValue.Text           = "Link zu Dokument";
                            lfValue.UseDefaultIcon = false;

                            listitem["Link"] = lfValue;
                        }

                        if (!String.IsNullOrEmpty(AccountName) & listitem.Fields.ContainsField("AssignedTo"))
                        {
                            SPUserCollection users = web.Users;
                            SPUser user            = UserExists(users, AccountName.ToString());

                            if (user != null)
                            {
                                listitem["AssignedTo"] = user;
                            }
                            else
                            {
                                SPGroupCollection groups = web.Groups;

                                if (GroupExists(groups, AccountName.ToString()))
                                {
                                    listitem["AssignedTo"] = web.Groups[AccountName.ToString()];
                                }
                            }
                        }

                        if (!String.IsNullOrEmpty(Quelle) & listitem.Fields.ContainsField("Aufgabenquelle"))
                        {
                            listitem["Aufgabenquelle"] = Quelle.ToString();
                        }

                        if ((TargetDate.ToString() != string.Empty) & (listitem.Fields.ContainsField("DueDate")))
                        {
                            listitem["DueDate"] = TargetDate;
                        }

                        if (listitem.Fields.ContainsField("WorkflowID"))
                        {
                            listitem["WorkflowID"] = WorkflowID;
                        }

                        listitem.Update();
                        TaskID = listitem.ID;
                    }
                }
            });
            return(base.Execute(executionContext));
        }
Exemplo n.º 5
0
        public override string ToString()
        {
            string json = string.Concat(
                __jsonIgnore.ContainsKey("Id") ? string.Empty : string.Format(", Id : {0}", Id == null ? "null" : Id.ToString()),
                __jsonIgnore.ContainsKey("Order_id") ? string.Empty : string.Format(", Order_id : {0}", Order_id == null ? "null" : Order_id.ToString()),
                __jsonIgnore.ContainsKey("Productitem_id") ? string.Empty : string.Format(", Productitem_id : {0}", Productitem_id == null ? "null" : Productitem_id.ToString()),
                __jsonIgnore.ContainsKey("Create_time") ? string.Empty : string.Format(", Create_time : {0}", Create_time == null ? "null" : Create_time.Value.Subtract(new DateTime(1970, 1, 1)).TotalMilliseconds.ToString()),
                __jsonIgnore.ContainsKey("Descript") ? string.Empty : string.Format(", Descript : {0}", Descript == null ? "null" : string.Format("'{0}'", Descript.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("Email") ? string.Empty : string.Format(", Email : {0}", Email == null ? "null" : string.Format("'{0}'", Email.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("Img_url") ? string.Empty : string.Format(", Img_url : {0}", Img_url == null ? "null" : string.Format("'{0}'", Img_url.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("State") ? string.Empty : string.Format(", State : {0}", State == null ? "null" : string.Format("'{0}'", State.ToDescriptionOrString().Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("Tel") ? string.Empty : string.Format(", Tel : {0}", Tel == null ? "null" : string.Format("'{0}'", Tel.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("Telphone") ? string.Empty : string.Format(", Telphone : {0}", Telphone == null ? "null" : string.Format("'{0}'", Telphone.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("Wealth") ? string.Empty : string.Format(", Wealth : {0}", Wealth == null ? "null" : Wealth.ToString()), " }");

            return(string.Concat("{", json.Substring(1)));
        }
Exemplo n.º 6
0
        public string this[string columnName]
        {
            get
            {
                string error = String.Empty;
                switch (columnName)
                {
                case "Model":
                    if (Model == null)
                    {
                        error = "Введите значение";
                    }
                    else if (Model.Count() < 1)
                    {
                        error = "Введите значение";
                    }
                    else if (Model.Count() > 70)
                    {
                        error = "Максимальное количество символов = 70";
                    }
                    break;

                case "Manufact":
                    if (Manufact == null)
                    {
                        error = "Введите значение";
                    }
                    else if (Manufact.Count() < 1)
                    {
                        error = "Введите значение";
                    }
                    else if (Manufact.Count() > 70)
                    {
                        error = "Максимальное количество символов = 70";
                    }
                    break;

                case "Price":
                    if (Price < 0)
                    {
                        error = "Минимальная цена = 0";
                    }
                    else if (Price > 1000000)
                    {
                        error = "Максимальная цена = 1000000";
                    }
                    break;

                case "Os":
                    if (Os == null)
                    {
                        error = "Минимальное количество символов = 3";
                    }
                    else if (Os.Count() < 3)
                    {
                        error = "Минимальное количество символов = 3";
                    }
                    else if (Os.Count() > 40)
                    {
                        error = "Максимальное количество символов = 40";
                    }
                    break;

                case "Memory":
                    if (Memory < 0)
                    {
                        error = "Минимальное значение = 0";
                    }
                    else if (Memory > 512)
                    {
                        error = "Значение должно быть < 512";
                    }
                    break;

                case "Ram":
                    if (Ram < 0)
                    {
                        error = "Минимальное значение = 0";
                    }
                    else if (Ram > 16)
                    {
                        error = "Значение должно быть < 16";
                    }
                    break;

                case "Screen":
                    if (Screen < 0)
                    {
                        error = "Минимальное значение = 0";
                    }
                    else if (Screen > 10)
                    {
                        error = "Максимальное значение = 10";
                    }
                    break;

                case "Cam":
                    if (Cam < 0)
                    {
                        error = "Минимальное значение = 0";
                    }
                    else if (Cam > 30)
                    {
                        error = "Максимальное значение = 30";
                    }
                    break;

                case "Battery":
                    if (Battery < 0)
                    {
                        error = "Минимальное значение = 0";
                    }
                    else if (Battery > 10000)
                    {
                        error = "Максимальное значение = 10000";
                    }
                    break;

                case "Descript":
                    if (Descript == null)
                    {
                        error = "Введите значение";
                    }
                    else if (Descript.Count() < 1)
                    {
                        error = "Введите значение";
                    }
                    else if (Descript.Count() > 1000)
                    {
                        error = "Максимальное количество символов = 1000";
                    }
                    break;
                }
                return(error);
            }
        }