Esempio n. 1
0
        public void InitialRptForm(Models.ys_CheckOrder model)
        {
            #region 获取数据
            BLL.CheckOrderManager manager = new BLL.CheckOrderManager();
            System.Data.DataTable dt      = manager.GetAllTable(model.Id);
            this.DataSource = dt;
            #endregion

            #region 订单信息
            this.IsAudit.Checked = model.IsAudit;
            IsAudit.Text         = IsAudit.Checked == true ? "已审核" : "未审核";
            labCheckday.Text     = model.Checkday.ToString();
            labCheckNo.Text      = model.CheckNo;
            labDescription.Text  = model.Description;
            labOperator.Text     = model.OperatorName;
            labPrintTime.Text    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            #endregion

            #region 订单明细
            txtName.DataBindings.Add("Text", null, "Name");
            txtBarcode.DataBindings.Add("Text", null, "Barcode");
            txtModel.DataBindings.Add("Text", null, "Model");
            txtCategory.DataBindings.Add("Text", null, "CategoryName");
            txtStatus.DataBindings.Add("Text", null, "StatusName");
            txtIsCheck.DataBindings.Add("Text", null, "IsSelect");
            txtIsCheckTime.DataBindings.Add("Text", null, "IsCheckTime");
            txtCheckUserName.DataBindings.Add("Text", null, "CheckUserName");
            #endregion
        }
Esempio n. 2
0
        public override void Query()
        {
            txtCheckNo.Text      = _model.CheckNo;
            Checkday.EditValue   = _model.Checkday;
            txtOperatorName.Text = _model.OperatorName;
            txtDescription.Text  = _model.Description;
            cIsAudit.Checked     = _model.IsAudit;
            gcData.DataSource    = dtAll = manager.GetAllTable(_model.Id);

            gvData.GroupPanelText = string.Format("本次盘点资产{0}件,已盘{1}件,盘差{2}件", dtAll.Rows.Count, dtAll.Select("IsSelect=true").Length, dtAll.Select("IsSelect=false").Length);
        }
 /// <summary>
 /// 修改盘点单
 /// </summary>
 /// <param name="checkId">单号Id</param>
 public AssetsCheckEditForm(Guid checkId) : this()
 {
     model = manager.GetOneByCheckId(checkId);
     if (model != null)
     {
         txtCheckNo.Text      = model.CheckNo;
         Checkday.EditValue   = model.Checkday;
         txtOperatorName.Text = model.OperatorName;
         txtDescription.Text  = model.Description;
         cIsAudit.Checked     = model.IsAudit;
         gcData.DataSource    = dtAll = manager.GetAllTable(checkId);
         if (model.IsAudit)
         {
             gvData.OptionsBehavior.Editable = false;
         }
     }
 }
Esempio n. 4
0
        /// <summary>
        /// 盘点反审核
        /// </summary>
        public override void UnApprove()
        {
            if (gvData.FocusedRowHandle >= 0)
            {
                Guid Id = (Guid)gvData.GetFocusedRowCellValue("Id");
                Models.ys_CheckOrder _model = allList.FirstOrDefault(a => a.Id == Id);
                if (_model != null)
                {
                    if (!model.IsAudit)
                    {
                        MessageBox.Show("盘点单未审核不能反审核"); return;
                    }
                    DataTable Dt = manager.GetAllTable(_model.Id);
                    _model.OperatorId   = clsSession._UserId;
                    _model.OperatorName = clsSession._FullName;
                    string msg = string.Format("本次盘点资产{0}件,已盘{1}件,盘差{2}件 --- 是否反审核?", Dt.Rows.Count, Dt.Select("IsSelect=true").Length, Dt.Select("IsSelect=false").Length);
                    if (clsPublic.GetMessageBoxYesNoResult(msg, Text))
                    {
                        List <Models.ys_CheckOrderDeail> list = new List <Models.ys_CheckOrderDeail>();

                        Dt.DefaultView.RowFilter = "IsSelect=False";
                        DataTable newdt = Dt.DefaultView.ToTable();
                        foreach (DataRow r in newdt.Rows)
                        {
                            Models.ys_CheckOrderDeail d = new Models.ys_CheckOrderDeail();
                            d.AssetsId    = (System.Guid)r["AssetsId"];
                            d.OldStatusId = r["OldStatusId"].ToString();
                            d.CheckId     = (System.Guid)r["CheckId"];
                            list.Add(d);
                        }
                        _model.Details = list;
                        if (manager.UnApprove(_model))
                        {
                            MessageBox.Show("成功");
                        }
                        else
                        {
                            MessageBox.Show("失败");
                        }
                    }
                }
            }
        }