public static Article GetArticle(string articleName)
        {
            DataOperator dop = new DataOperator(Runtime.SqlConfig);

            Article article = dop.SelectSingle<Article>("AName='" + articleName + "'");
            return article;
        }
Example #2
0
        private void btnChongZhi_Click(object sender, EventArgs e)
        {
            DataOperator dop = new DataOperator(UccRuntime.SqlConfig);
            User user = new User();
            user.UserID = this.txtUserID.Text;
            user = dop.SelectSingle(user) as User;

            double shishou = 0;
            if (double.TryParse(this.txtShiShou.Text, out shishou))
                user.Money += shishou;
            double zengsong = 0;
            if (double.TryParse(this.txtZengSong.Text, out zengsong))
                user.Money += zengsong;
            //user.Money = double.Parse(this.txtMoney.Text) + double.Parse(this.txtShiShou.Text) + int.Parse(this.txtZengSong.Text);
            dop.Update(user);

            MoneyHistory history = new MoneyHistory();
            history.UserID = this.txtUserID.Text;
            history.UserName = this.txtUserName.Text;
            history.MoneyID = "M" + DateTime.Now.ToString("yyyyMMdd") + dop.Count<MoneyHistory>();
            history.MoneyTime = DateTime.Now;
            history.ShiShouMoney = shishou;
            history.ZengSongMoney = zengsong;
            dop.Insert(history);
            dop.Commit();

            MessageBox.Show("操作成功!");
        }
 public ActionResult Update(string categoryName)
 {
     DataOperator dop=new DataOperator(Runtime.SqlConfig);
     Category category = new Category();
     category.CategoryName = categoryName;
     category = dop.SelectSingle(category) as Category;
     return View(category);
 }
 public ActionResult Delete(string ArticleID)
 {
     DataOperator dop = new DataOperator(Runtime.SqlConfig);
     Article article = new Article();
     article.ArticleID = ArticleID;
     article = dop.SelectSingle(article) as Article;
     return View(article);
 }
 public ActionResult Article(string categoryName, string articleName)
 {
     DataOperator dop = new DataOperator(Runtime.SqlConfig);
     Article item = new FreeRoo.Article();
     item.AName = articleName;
     item = dop.SelectSingle(item) as Article;
     return View(item);
 }
Example #6
0
 private void btnUserID_Click(object sender, EventArgs e)
 {
     DataOperator dop = new DataOperator(UccRuntime.SqlConfig);
     User user = new User();
     user.UserID = this.txtUserID.Text;
     user = dop.SelectSingle(user) as User;
     this.txtUserName.Text = user.UserName;
     this.txtMoney.Text = user.Money.ToString();
 }
 public ActionResult DoUpdate(string Tags)
 {
     DataOperator dop = new DataOperator(Runtime.SqlConfig);
     string[] array = Tags.Split(',');
     List<ArticleTag> list = new List<ArticleTag>();
     foreach(var item in array)
     {
         ArticleTag tag = new ArticleTag();
         tag.TagName = item;
         tag.TagTitle = item;
         if (dop.SelectSingle(tag) == null)
             dop.Update<ArticleTag>(tag);
     }
     return Redirect("/Admin/Success.do");
 }
Example #8
0
        private void btnKaiDan_Click(object sender, EventArgs e)
        {
            try
            {
                foreach(var item in GetYiFuList())
                {
                    foreach(var tempItem in GetYiFuList())
                    {
                        if (tempItem != item && item.ClotheID == tempItem.ClotheID)
                        {
                            MessageBox.Show("衣服里面有重复的衣服单号!请检查一下!衣服单号:" + item.ClotheID);
                            return;
                        }
                    }
                }
                DataOperator dop = new DataOperator(UccRuntime.SqlConfig);

                if (Ticket == null)
                    Ticket = new ShouYi();
                Ticket.TicketID = this.txtTicketID.Text;
                var temp = dop.SelectSingle(Ticket) as ShouYi;
                if (temp != null)
                {
                    MessageBox.Show("此单号已经开过!请重新开单!");
                    return;
                }

                Ticket.UserID = this.txtUserID.Text;
                Ticket.UserName = this.txtUserName.Text;
                Ticket.PhoneNo = this.txtPhone.Text;
                Ticket.Address = this.txtAddress.Text;
                Ticket.PutWay = this.cbxPutWay.SelectedItem.ToString();
                Ticket.Price = this.txtThisMoney.Text;
                Ticket.State = "未洗";
                Ticket.MoneyState = this.cbxMoneyState.Text;
                Ticket.ShouYiDateTime = DateTime.Parse(this.datePutIn.Text);
                Ticket.QuYiDateTime = DateTime.Parse(this.datePutOut.Text);
                Ticket.ZheKou = double.Parse(this.cbxZheKou.Text);
                dop.Insert(Ticket);

                for (int i = 0; i < this.YiFuList.Count; i++)
                {
                    var item = this.YiFuList[i];
                    item.ClotheID = item.TicketID + "-" + (i + 1);
                    dop.Insert(item);
                }
                dop.Commit();
                MessageBox.Show("操作成功!");
            }
            catch (Exception ex)
            {
                MessageBox.Show("操作失败!" + ex.Message + ex.StackTrace);
            }
        }
 public static Category GetCategory(string categoryName)
 {
     DataOperator dop = new DataOperator(Runtime.SqlConfig);
     Category category = new Category();
     category.CategoryName = categoryName;
     category = dop.SelectSingle(category) as Category;
     return category;
 }