Esempio n. 1
0
        /// <summary>
        /// 获得实体
        /// </summary>
        /// <returns></returns>
        private CheckOrder EntityGet()
        {
            CheckOrder entity = new CheckOrder();

            entity.ID = HTDataID;
            return(entity);
        }
Esempio n. 2
0
        /// <summary>
        /// 获得实体
        /// </summary>
        /// <returns></returns>
        private CheckOrder EntityGet()
        {
            CheckOrder entity = new CheckOrder();

            entity.ID = HTDataID;
            entity.SelectByID();

            entity.FormNo              = txtFormNo.Text.Trim();
            entity.FormDate            = txtFormDate.DateTime.Date;
            entity.AutoCreateFlag      = SysConvert.ToInt32(txtAutoCreateFlag.Text.Trim());
            entity.SaleProcedureID     = SysConvert.ToInt32(txtSaleProcedureID.Text.Trim());
            entity.SaleProcedureFormNo = txtSaleProcedureFormNo.Text.Trim();
            entity.VendorID            = txtVendorID.Text.Trim();
            entity.ItemCode            = txtItemCode.Text.Trim();
            entity.ItemName            = txtItemName.Text.Trim();
            entity.ItemStd             = txtItemStd.Text.Trim();
            entity.ItemModel           = txtItemModel.Text.Trim();
            entity.MWidth              = txtMWidth.Text.Trim();
            entity.MWeight             = txtMWeight.Text.Trim();
            entity.Remark              = txtRemark.Text.Trim();

            if (HTFormStatus == FormStatus.新增)
            {
                entity.MakeOPID   = FParamConfig.LoginID;
                entity.MakeOPName = FParamConfig.LoginName;
                entity.MakeDate   = DateTime.Now;
            }


            return(entity);
        }
Esempio n. 3
0
        /// <summary>
        /// 根据盘点单唯一编号删除盘点单
        /// </summary>
        /// <returns></returns>
        public ActionResult DeleteSingle()
        {
            string CompanyID            = WebUtil.GetFormValue <string>("CompanyID", string.Empty);
            string SnNum                = WebUtil.GetFormValue <string>("SnNum", string.Empty);
            InventoryOrderEntity entity = new InventoryOrderEntity();

            entity.SnNum     = SnNum;
            entity.CompanyID = CompanyID;

            Bill <InventoryOrderEntity, InventoryDetailEntity> bill = new CheckOrder(CompanyID);
            string     returnValue = bill.Delete(entity);
            DataResult result      = new DataResult();

            if (EnumHelper.GetEnumDesc <EReturnStatus>(EReturnStatus.Success) == returnValue)
            {
                result.Code    = (int)EResponseCode.Success;
                result.Message = "盘点单删除成功";
            }
            else
            {
                result.Code    = (int)EResponseCode.Exception;
                result.Message = "盘点单删除失败";
            }
            return(Content(JsonHelper.SerializeObject(result)));
        }
Esempio n. 4
0
 public void LoadBarcode(CheckOrder Obj)
 {
     try
     {
         string[] colValues = new string[]
         {
             Obj.LotID, Obj.SampleID, Obj.PlanCheckDate, Obj.HutName,
             Obj.CheckQuantity.ToString(), Obj.PlanInspector, Obj.DefinitionName, Obj.Creator
         };
         if (Obj.GetPlanCheckItemCount > 0)
         {
             List <string> listCheckItems = new List <string>();
             foreach (short id in Obj.PlanCheckItems)
             {
                 string name = CheckItem.Instance.GetNamebyID(id);
                 if (!string.IsNullOrWhiteSpace(name) && !listCheckItems.Contains(name))
                 {
                     listCheckItems.Add(name);
                 }
             }
             LoadBarcode(wbv, "样品条码卡", lsName, colValues, Obj.SampleID, listCheckItems.ToArray());
         }
     }
     catch (Exception)
     {
     }
 }
Esempio n. 5
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int Delete(BaseEntity p_Entity)
        {
            try
            {
                CheckOrder MasterEntity = (CheckOrder)p_Entity;
                if (MasterEntity.ID == 0)
                {
                    return(0);
                }

                //删除主表数据
                string Sql = "";
                Sql = "DELETE FROM Chk_CheckOrder WHERE " + "ID=" + SysString.ToDBString(MasterEntity.ID);
                //执行
                int AffectedRows = 0;
                if (!this.sqlTransFlag)
                {
                    AffectedRows = this.ExecuteNonQuery(Sql);
                }
                else
                {
                    AffectedRows = sqlTrans.ExecuteNonQuery(Sql);
                }

                return(AffectedRows);
            }
            catch (BaseException E)
            {
                throw new BaseException(E.Message, E);
            }
            catch (Exception E)
            {
                throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBDelete), E);
            }
        }
Esempio n. 6
0
        /// <summary>
        /// 设置
        /// </summary>
        public override void EntitySet()
        {
            CheckOrder entity = new CheckOrder();

            entity.ID = HTDataID;
            bool findFlag = entity.SelectByID();

            txtFormNo.Text              = entity.FormNo.ToString();
            txtFormDate.DateTime        = entity.FormDate;
            txtAutoCreateFlag.Text      = entity.AutoCreateFlag.ToString();
            txtSaleProcedureID.Text     = entity.SaleProcedureID.ToString();
            txtSaleProcedureFormNo.Text = entity.SaleProcedureFormNo.ToString();
            txtVendorID.Text            = entity.VendorID.ToString();
            txtItemCode.Text            = entity.ItemCode.ToString();
            txtItemName.Text            = entity.ItemName.ToString();
            txtItemStd.Text             = entity.ItemStd.ToString();
            txtItemModel.Text           = entity.ItemModel.ToString();
            txtMWidth.Text              = entity.MWidth.ToString();
            txtMWeight.Text             = entity.MWeight.ToString();
            txtRemark.Text              = entity.Remark.ToString();
            txtMakeOPID.Text            = entity.MakeOPID.ToString();
            txtMakeOPName.Text          = entity.MakeOPName.ToString();
            txtMakeDate.DateTime        = entity.MakeDate;


            HTDataSubmitFlag = entity.SubmitFlag;
            HTDataDelFlag    = entity.DelFlag;
            if (!findFlag)
            {
            }

            BindGridDts();
        }
Esempio n. 7
0
        public ActionResult CheckOrder([Bind(Include = "Id,ShipmentAdress,InvoiceAdress,CreateDate,NameSurname,InvoiceName,SessionId")] CheckOrder checkorder)
        {
            var cartitems = dbContext.CartItems.ToList();

            if (ModelState.IsValid)
            {
                string sessionId = Session["sessionId"].ToString();
                checkorder.SessionId  = sessionId;
                checkorder.CreateDate = DateTime.Now;
                var     cart       = (Cart)ViewBag.CurrentCart;
                decimal?totalPrice = 0;
                foreach (var item in cart.CartItems)
                {
                    totalPrice += item.Product.Price;
                }
                checkorder.TotalPrice = totalPrice.Value;
                dbContext.CheckOrders.Add(checkorder);

                dbContext.Carts.Remove(cart);
                dbContext.SaveChanges();
                return(RedirectToAction("Shopping"));
            }

            return(View(checkorder));
        }
Esempio n. 8
0
        private void tsbApprove_Click(object sender, EventArgs e)
        {
            string             username = User.CurrentUser != null ? User.CurrentUser.ParamName : string.Empty;
            UsageDecisionsForm form     = new UsageDecisionsForm();

            if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                var ud = form.UsageDecisionResult;
                if (ud == null)
                {
                    return;
                }
                ReturnValue rv = CheckOrder.UpdateSampleOrderState(_sampleOrder.SampleID, username, CheckOrderStateEnum.Approve, ud.ParamID);

                if (rv.Success)
                {
                    _sampleOrder.UsageDecisions  = ud.ParamID;
                    _sampleOrder.CheckOrderState = CheckOrderStateEnum.Approve;
                    _sampleOrder.Auditor         = username;
                    SetOrderState();
                }
                ReturnValue.ShowMessage(rv);
                this.Close();
            }
        }
Esempio n. 9
0
 // Use this for initialization
 void Start()
 {
     currentObj    = gameObject;
     gameViewer    = currentObj.transform.gameObject;
     mixCheckOrder = GameObject.Find("Mixsolution").GetComponent <CheckOrder> ();
     call          = GameObject.Find("GameObject").GetComponent <LoadClassroom> ();
 }
Esempio n. 10
0
        public CheckDataInputForm(CheckOrder order)
        {
            //test
            //order.CheckOrderState = CheckOrderStateEnum.Submit;
            _sampleOrder = order;

            InitializeComponent();

            _Grid = new SSITGridView <CheckOrder>()
            {
                Dock                     = DockStyle.Fill,
                MultiSelect              = true,
                AllowDeleteRow           = false,
                AllowAddNewRow           = false,
                AllowEditRow             = false,
                AllowToolBar             = true,
                AllowBottomToolBar       = false,
                AllowBottomToolBarFilter = false,
                AllowDragToGroup         = false,
                AllowPaging              = false,
                GridFilterMode           = FilterMode.CustomFilter
            };
            _Grid.ToolBar.Visible = false;
            twSampleOrder.Controls.Add(_Grid);
            EncodeCollection <CheckOrder> ec = new EncodeCollection <CheckOrder>();

            ec.Add(order);
            _Grid.FillGrid(ec);
            //_sampleOrderGrid.SetGrid(ec);
            tsbSampleCount.Text = order.CheckQuantity.ToString();
            tsbNote.Text        = order.Note;
            LoadImage(order.SampleID);
            LoadInfo();
        }
Esempio n. 11
0
        /// <summary>
        /// 删除
        /// </summary>
        public override void EntityDelete()
        {
            CheckOrderRule rule   = new CheckOrderRule();
            CheckOrder     entity = EntityGet();

            rule.RDelete(entity);
        }
Esempio n. 12
0
        /// <summary>
        /// 保存(传入事务处理)
        /// </summary>
        /// <param name="p_Entity"></param>
        /// <param name="p_BE"></param>
        /// <param name="sqlTrans"></param>
        public void RSave(CheckOrder p_Entity, BaseEntity[] p_BE, IDBTransAccess sqlTrans)
        {
            try
            {
                string sql = "DELETE FROM Chk_CheckOrderDts WHERE MainID=" + p_Entity.ID.ToString();
                sql += " AND ID NOT IN" + string.Format("({0})", GetIDExist(p_BE));
                sqlTrans.ExecuteNonQuery(sql);                                                                             //删除原单据里应该删除的明细数据,即数据库里有但是UI里已经删除的数据
                sql = "SELECT ISNULL(MAX(Seq),0)+1 As MSEQ FROM Chk_CheckOrderDts WHERE MainID=" + p_Entity.ID.ToString(); ////找到最大的Seq    将获得最大Seq的语句放到循环外更高效(多人操作时会有问题吗?)
                int MSEQ = SysConvert.ToInt32(sqlTrans.Fill(sql).Rows[0][0].ToString());
                for (int i = 0; i < p_BE.Length; i++)
                {
                    CheckOrderDts entitydts = (CheckOrderDts)p_BE[i];
                    if (entitydts.ID != 0)//ID不为0说明数据库中已经存在
                    {
                        this.RUpdate(entitydts, sqlTrans);
                    }
                    else
                    {
                        entitydts.Seq    = MSEQ;
                        entitydts.MainID = p_Entity.ID;
                        this.RAdd(entitydts, sqlTrans);

                        MSEQ++;//最大值加1
                    }
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 13
0
    /// <summary>
    /// When the customer is served it sets a int which determines which
    /// customer is served by which chef.
    /// After that it checks if the order is correct if it is, necessary score is calculated.
    /// if the order is not correct the customer starts losing time faster and if the correct
    /// order is not fed to the customer.
    /// </summary>
    private void CheckContents()
    {
        Customer currentcustomer = currentCollider.GetComponent <Customer>();

        if (gameObject.name == "Player_1")
        {
            currentcustomer.servedBy = 0;
        }
        else
        {
            currentcustomer.servedBy = 1;
        }

        bool isordercorrect = CheckOrder.CompareLists(saladToServe, currentcustomer.m_RequestedSalad);

        if (isordercorrect)
        {
            m_ChefScore += CalculateScore.m_Instance.CalculatePositiveScore(currentcustomer.m_RemainingTime, currentcustomer.m_WaitTime);
            ClearEverthing();
            Destroy(currentcustomer.gameObject);
        }
        else
        {
            currentcustomer.decreasemulti = 0.5f;
            ClearEverthing();
        }
    }
Esempio n. 14
0
 public void ThenUserDeletesTheItems()
 {
     checkout = new CheckOrder();
     PageFactory.InitElements(_driver, checkout);
     checkout.lnk_ChangeQty.Click();
     checkout.lnk_Delete.Click();
     Assert.AreEqual("Tu carrito de Amazon está vacío.", checkout.lbl_EmptyCart.Text);
 }
Esempio n. 15
0
 public bool GetResults(CheckOrder order)
 {
     if (!_checkOrders.Contains(order))
     {
         _checkOrders.Add(order);
         CurrentDay += DayDelay;
     }
     return(_drops.Any(x => x));
 }
Esempio n. 16
0
        /// <summary>
        /// 修改
        /// </summary>
        public override void EntityUpdate()
        {
            CheckOrderRule rule   = new CheckOrderRule();
            CheckOrder     entity = EntityGet();

            CheckOrderDts[] entitydts = EntityDtsGet();
            entity.SubmitFlag = this.HTSubmitFlagUpdateGet();
            rule.RUpdate(entity, entitydts);
        }
Esempio n. 17
0
        /// <summary>
        /// 新增
        /// </summary>
        public override int EntityAdd()
        {
            CheckOrderRule rule   = new CheckOrderRule();
            CheckOrder     entity = EntityGet();

            CheckOrderDts[] entitydts = EntityDtsGet();

            entity.SubmitFlag = this.HTSubmitFlagInsertGet();
            rule.RAdd(entity, entitydts);
            return(entity.ID);
        }
Esempio n. 18
0
        static void Main(string[] args)
        {
            QuotBuilder obj = new QuotBuilder();

            System.Console.WriteLine(obj.beginQuot()
                                     .setContent("Hello World!")
                                     .endQuot()
                                     .getQuot());

            CheckOrder check = new CheckOrder("1124554211");

            System.Console.WriteLine(check.check());
        }
Esempio n. 19
0
        void OnSampleSelectedChanged(object sender, EventArgs e)
        {
            var sample = _sampleOrderGrid.SelectedItem;

            if (sample != null)
            {
                if (sample != _sampleOrder)
                {
                    _sampleOrder = sample;
                    LoadInfo();
                }
            }
        }
Esempio n. 20
0
 public CreateCheckOrderForm(SampleOrder sample)
 {
     OrderItem = CheckOrder.CreateCheckOrderbySample(sample);
     InitializeComponent();
     ckbAuto.CheckState     = CheckState.Unchecked;
     GetSampleState.Text    = sample.GetSampleState;
     GetSampleState.Enabled = false;
     SampleType.Enabled     = false;
     OrderItem.CheckType    = CheckTypeEnum.Normal;
     Init();
     //调用基类的RefreshForm方法 ,从实体获取数据 刷新界面上的控件
     RefreshForm <CheckOrder>(OrderItem); //调用基类方法,刷新控件值
 }
Esempio n. 21
0
        public ActionResult Save()
        {
            int              Type          = WebUtil.GetFormValue <int>("Type", (int)ECheckType.Local);
            int              ProductType   = WebUtil.GetFormValue <int>("ProductType", (int)EProductType.Goods);
            string           ContractOrder = WebUtil.GetFormValue <string>("ContractOrder", string.Empty);
            DateTime         CreateTime    = WebUtil.GetFormValue <DateTime>("CreateTime", DateTime.Now);
            string           Remark        = WebUtil.GetFormValue <string>("Remark", string.Empty);
            string           TargetNum     = WebUtil.GetFormValue <string>("TargetNum", string.Empty);
            CheckStockEntity entity        = new CheckStockEntity();
            string           orderNum      = SequenceProvider.GetSequence(typeof(CheckStockEntity));

            entity.OrderNum      = orderNum;
            entity.Type          = Type;
            entity.ProductType   = ProductType;
            entity.ContractOrder = ContractOrder;
            entity.Status        = (int)EAudite.Wait;
            entity.IsDelete      = (int)EIsDelete.NotDelete;
            entity.CreateTime    = CreateTime;
            entity.CreateUser    = this.LoginUser.UserCode;
            entity.OperateType   = (int)EOpType.PC;
            entity.IsComplete    = (int)EBool.No;
            entity.Remark        = Remark;
            entity.StorageNum    = this.DefaultStore;

            List <ProductEntity> ListProducts = Session[CacheKey.JOOSHOW_CHECKDETAIL_CACHE] as List <ProductEntity>;

            ListProducts = ListProducts.IsNull() ? new List <ProductEntity>() : ListProducts;

            List <CheckStockInfoEntity> listDetail = new List <CheckStockInfoEntity>();
            string storageNum = this.DefaultStore;

            foreach (ProductEntity key in ListProducts)
            {
                CheckStockInfoEntity detail = new CheckStockInfoEntity();
                detail.OrderNum   = orderNum;
                detail.TargetNum  = key.SnNum;
                detail.StorageNum = storageNum;
                detail.CreateTime = DateTime.Now;
                listDetail.Add(detail);
            }

            Bill <CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder();
            string returnValue = bill.Create(entity, listDetail);

            if (returnValue == EnumHelper.GetEnumDesc <EReturnStatus>(EReturnStatus.Success))
            {
                this.ReturnJson.AddProperty("Key", "1000");
                this.ReturnJson.AddProperty("Value", "盘点单创建成功");
            }
            return(Content(this.ReturnJson.ToString()));
        }
        public ActionResult Delete()
        {
            string OrderNum = WebUtil.GetFormValue <string>("OrderNum", string.Empty);

            if (!OrderNum.IsEmpty())
            {
                Bill <CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder();
                CheckStockEntity entity = new CheckStockEntity();
                entity.OrderNum = OrderNum;
                string returnValue = bill.Delete(entity);
                this.ReturnJson.AddProperty("d", returnValue);
            }
            return(Content(this.ReturnJson.ToString()));
        }
Esempio n. 23
0
        /// <summary>
        /// 检验字段值是否已存在
        /// </summary>
        /// <param name="p_TableName">表名</param>
        /// <param name="p_FieldName">字段名</param>
        /// <param name="p_FieldValue">字段值</param>
        /// <param name="p_KeyField">主键(只考虑主键为ID的情况)</param>
        /// <param name="p_KeyValue">主键值</param>
        /// <param name="p_sqlTrans"></param>
        /// <returns></returns>
        private bool CheckFieldValueIsExist(BaseEntity p_BE, string p_FieldName, string p_FieldValue, IDBTransAccess p_sqlTrans)
        {
            CheckOrder entity = (CheckOrder)p_BE;
            bool       ret    = false;
            string     sql    = string.Format(" SELECT {0} FROM {1} WHERE 1=1 AND {0}={2} AND {3}<>{4}", p_FieldName, CheckOrder.TableName, SysString.ToDBString(p_FieldValue), "ID", entity.ID);
            DataTable  dt     = p_sqlTrans.Fill(sql);

            if (dt.Rows.Count != 0)
            {
                ret = true;
            }

            return(ret);
        }
 public ActionResult DeleteBatch([ModelBinder(typeof(JsonBinder <List <string> >))] List <string> list)
 {
     if (!list.IsNullOrEmpty())
     {
         foreach (string orderNum in list)
         {
             Bill <CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder();
             CheckStockEntity entity = new CheckStockEntity();
             entity.OrderNum = orderNum;
             string returnValue = bill.Delete(entity);
             this.ReturnJson.AddProperty("d", returnValue);
         }
     }
     return(Content(this.ReturnJson.ToString()));
 }
 // Update is called once per frame
 void Update()
 {
     checkOrder   = GameObject.Find("Mixsolution").GetComponent <CheckOrder> ();
     call         = GameObject.Find("GameObject").GetComponent <LoadClassroom>();
     elementOrder = checkOrder.getMixOrder();
     if (elementOrder [0] == call.getmixElementA() && elementOrder [1] == call.getmixElementB())
     {
         handleMixReaction();
         checkOrder.setEmpty();
     }
     else if (elementOrder [0] == call.getmixElementB() && elementOrder [1] == call.getmixElementA())
     {
         handleMixReverseReaction();
         checkOrder.setEmpty();
     }
 }
Esempio n. 26
0
        /// <summary>
        /// 获得布实体
        /// </summary>
        /// <returns></returns>
        public CheckOrderISN EntityGet()
        {
            CheckOrderISN enity = new CheckOrderISN();

            enity.ID = ISNID;
            enity.SelectByID();

            CheckOrderDts entityp = new CheckOrderDts();//检验指示单明细表信息

            entityp.ID = DtsID;
            entityp.SelectByID();
            CheckOrder entityM = new CheckOrder();//检验指示单主表信息

            entityM.ID = entityp.MainID;
            entityM.SelectByID();

            enity.ItemCode  = entityM.ItemCode;
            enity.ItemName  = entityM.ItemName;
            enity.ItemStd   = entityM.ItemStd;
            enity.ItemModel = entityM.ItemModel;
            enity.MWeight   = entityM.MWeight;
            enity.MWidth    = entityM.MWidth;

            enity.ColorNum    = entityp.ColorNum;
            enity.ColorName   = entityp.ColorName;
            enity.Batch       = entityp.Batch;
            enity.VendorBatch = entityp.VendorBatch;
            //enity.JarNum = entityp.JarNum;
            enity.JarNum = lblJarNum.Text.Trim();
            enity.YQty   = entityp.Qty;//原米数
            if (SysConvert.ToDecimal(lblQty.Text.Trim()) != 0m)
            {
                enity.ChkQty = SysConvert.ToDecimal(lblQty.Text.Trim());
            }
            else
            {
                throw new Exception("数据异常,未读取到码表数据,请稍后重新点击");
            }
            enity.ChkMWeight = entityM.MWeight; //检验的克重
            enity.ChkMWidth  = entityM.MWidth;  //检验的门幅

            enity.CheckDate = DateTime.Now;
            enity.CheckOPID = FParamConfig.LoginID;
            //EndityGetSetValue(enity);//继承类附加属性

            return(enity);
        }
Esempio n. 27
0
 public ActionResult Detail()
 {
     string orderNum = WebUtil.GetQueryStringValue<string>("OrderNum", string.Empty);
     Bill<CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder();
     CheckStockEntity entity = new CheckStockEntity();
     entity.OrderNum = orderNum;
     entity = bill.GetOrder(entity);
     if (entity.IsNull())
     {
         return Redirect("/Check/Product/List");
     }
     entity.CheckTypeLable = EnumHelper.GetEnumDesc<ECheckType>(entity.Type);
     entity.ProductTypeLable = EnumHelper.GetEnumDesc<EProductType>(entity.ProductType);
     entity.StatusLable = EnumHelper.GetEnumDesc<EAudite>(entity.Status);
     ViewBag.Entity = entity;
     return View();
 }
Esempio n. 28
0
        /// <summary>
        /// 审核盘点单
        /// </summary>
        /// <returns></returns>
        public ActionResult Audite()
        {
            string SnNum         = WebUtil.GetFormValue <string>("SnNum");
            string CompanyID     = WebUtil.GetFormValue <string>("CompanyID", string.Empty);
            int    Status        = WebUtil.GetFormValue <int>("Status", (int)EAudite.NotPass);
            string AuditUser     = WebUtil.GetFormValue <string>("AuditUser", string.Empty);
            string Reason        = WebUtil.GetFormValue <string>("Reason", string.Empty);
            int    OperateType   = WebUtil.GetFormValue <int>("OperateType", 0);
            string EquipmentNum  = WebUtil.GetFormValue <string>("EquipmentNum");
            string EquipmentCode = WebUtil.GetFormValue <string>("EquipmentCode");
            string Remark        = WebUtil.GetFormValue <string>("Remark");

            InventoryOrderEntity entity = new InventoryOrderEntity();

            entity.SnNum         = SnNum;
            entity.CompanyID     = CompanyID;
            entity.Status        = Status;
            entity.AuditUser     = AuditUser;
            entity.Reason        = Reason;
            entity.OperateType   = OperateType;
            entity.EquipmentNum  = EquipmentNum;
            entity.EquipmentCode = EquipmentCode;
            entity.Remark        = Remark;

            Bill <InventoryOrderEntity, InventoryDetailEntity> bill = new CheckOrder(CompanyID);
            string     returnValue = bill.Audite(entity);
            DataResult result      = new DataResult();

            if ("1000" == returnValue)
            {
                result.Code    = (int)EResponseCode.Success;
                result.Message = "操作成功";
            }
            else if ("1001" == returnValue)
            {
                result.Code    = (int)EResponseCode.Exception;
                result.Message = "盘点单不存在";
            }
            else if ("1002" == returnValue)
            {
                result.Code    = (int)EResponseCode.Exception;
                result.Message = "盘点单已经审核";
            }
            return(Content(JsonHelper.SerializeObject(result)));
        }
Esempio n. 29
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="p_BE">要修改的实体</param>
 /// <param name="sqlTrans">事务类</param>
 public void RUpdate(BaseEntity p_BE, IDBTransAccess sqlTrans)
 {
     try
     {
         this.CheckCorrect(p_BE);
         CheckOrder    entity  = (CheckOrder)p_BE;
         CheckOrderCtl control = new CheckOrderCtl(sqlTrans);
         control.Update(entity);
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
Esempio n. 30
0
        /// <summary>
        /// 根据唯一编号查询盘点单主体信息
        /// </summary>
        /// <returns></returns>
        public ActionResult GetOrder()
        {
            string SnNum                = WebUtil.GetFormValue <string>("SnNum");
            string CompanyID            = WebUtil.GetFormValue <string>("CompanyID", string.Empty);
            InventoryOrderEntity entity = new InventoryOrderEntity();

            entity.SnNum     = SnNum;
            entity.CompanyID = CompanyID;
            Bill <InventoryOrderEntity, InventoryDetailEntity> bill = new CheckOrder(CompanyID);
            InventoryOrderEntity result = bill.GetOrder(entity);

            DataResult <InventoryOrderEntity> dataResult = new DataResult <InventoryOrderEntity>();

            dataResult.Code    = (int)EResponseCode.Success;
            dataResult.Message = "响应成功";
            dataResult.Result  = result;
            return(Content(JsonHelper.SerializeObject(dataResult)));
        }
Esempio n. 31
0
        public ActionResult Upload()
        {
            string orderNum = WebUtil.GetQueryStringValue <string>("OrderNum", string.Empty);
            Bill <CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder();
            CheckStockEntity entity = new CheckStockEntity();

            entity.OrderNum = orderNum;
            entity          = bill.GetOrder(entity);
            if (entity.IsNull())
            {
                return(Redirect("/Check/Product/List"));
            }
            entity.CheckTypeLable   = EnumHelper.GetEnumDesc <ECheckType>(entity.Type);
            entity.ProductTypeLable = EnumHelper.GetEnumDesc <EProductType>(entity.ProductType);
            entity.StatusLable      = EnumHelper.GetEnumDesc <EAudite>(entity.Status);
            ViewBag.Entity          = entity;
            return(View());
        }
 public ActionResult Delete()
 {
     string OrderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty);
     if (!OrderNum.IsEmpty())
     {
         Bill<CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder();
         CheckStockEntity entity = new CheckStockEntity();
         entity.OrderNum = OrderNum;
         string returnValue = bill.Delete(entity);
         this.ReturnJson.AddProperty("d", returnValue);
     }
     return Content(this.ReturnJson.ToString());
 }
 public ActionResult DeleteBatch([ModelBinder(typeof(JsonBinder<List<string>>))] List<string> list)
 {
     if (!list.IsNullOrEmpty())
     {
         foreach (string orderNum in list)
         {
             Bill<CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder();
             CheckStockEntity entity = new CheckStockEntity();
             entity.OrderNum = orderNum;
             string returnValue = bill.Delete(entity);
             this.ReturnJson.AddProperty("d", returnValue);
         }
     }
     return Content(this.ReturnJson.ToString());
 }
 public ActionResult GetList()
 {
     int status = WebUtil.GetFormValue<int>("Status", 0);
     string orderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty);
     string beginTime = WebUtil.GetFormValue<string>("BeginTime", string.Empty);
     string endTime = WebUtil.GetFormValue<string>("EndTime", string.Empty);
     CheckStockEntity entity = new CheckStockEntity();
     if (status > 0)
     {
         entity.Where(a => a.Status == status);
     }
     if (!orderNum.IsEmpty())
     {
         entity.Where("OrderNum", ECondition.Like, "%" + orderNum + "%");
     }
     if (!beginTime.IsEmpty() && !endTime.IsEmpty())
     {
         entity.Where("CreateTime", ECondition.Between, ConvertHelper.ToType<DateTime>(beginTime, DateTime.Now.AddDays(-1)), ConvertHelper.ToType<DateTime>(endTime, DateTime.Now));
     }
     entity.And(a => a.StorageNum == this.DefaultStore);
     int pageIndex = WebUtil.GetFormValue<int>("PageIndex", 1);
     int pageSize = WebUtil.GetFormValue<int>("PageSize", 10);
     PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize };
     Bill<CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder();
     List<CheckStockEntity> listResult = bill.GetList(entity, ref pageInfo);
     listResult = listResult.IsNull() ? new List<CheckStockEntity>() : listResult;
     string json = ConvertJson.ListToJson(listResult, "List");
     this.ReturnJson.AddProperty("Data", json);
     this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount);
     return Content(this.ReturnJson.ToString());
 }
 public ActionResult ToExcel()
 {
     int status = WebUtil.GetFormValue<int>("Status", 0);
     string orderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty);
     string beginTime = WebUtil.GetFormValue<string>("BeginTime", string.Empty);
     string endTime = WebUtil.GetFormValue<string>("EndTime", string.Empty);
     CheckStockEntity entity = new CheckStockEntity();
     if (status > 0)
     {
         entity.Where(a => a.Status == status);
     }
     if (!orderNum.IsEmpty())
     {
         entity.Where("OrderNum", ECondition.Like, "%" + orderNum + "%");
     }
     if (!beginTime.IsEmpty() && !endTime.IsEmpty())
     {
         entity.Where("CreateTime", ECondition.Between, ConvertHelper.ToType<DateTime>(beginTime, DateTime.Now.AddDays(-1)), ConvertHelper.ToType<DateTime>(endTime, DateTime.Now));
     }
     entity.And(a => a.StorageNum == this.DefaultStore);
     PageInfo pageInfo = new PageInfo() { PageIndex = 1, PageSize = Int32.MaxValue };
     Bill<CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder();
     List<CheckStockEntity> listResult = bill.GetList(entity, ref pageInfo);
     listResult = listResult.IsNull() ? new List<CheckStockEntity>() : listResult;
     if (!listResult.IsNullOrEmpty())
     {
         DataTable dt = new DataTable();
         dt.Columns.Add(new DataColumn("盘点单号"));
         dt.Columns.Add(new DataColumn("盘点类型"));
         dt.Columns.Add(new DataColumn("关联单号"));
         dt.Columns.Add(new DataColumn("状态"));
         dt.Columns.Add(new DataColumn("制单人"));
         dt.Columns.Add(new DataColumn("操作方式"));
         dt.Columns.Add(new DataColumn("创建时间"));
         foreach (CheckStockEntity t in listResult)
         {
             DataRow row = dt.NewRow();
             row[0] = t.OrderNum;
             row[1] = EnumHelper.GetEnumDesc<ECheckType>(t.Type);
             row[2] = t.ContractOrder;
             row[3] = EnumHelper.GetEnumDesc<EAudite>(t.Status);
             row[4] = t.CreateUserName;
             row[5] = EnumHelper.GetEnumDesc<EOpType>(t.OperateType);
             row[6] = t.CreateTime.ToString("yyyy-MM-dd");
             dt.Rows.Add(row);
         }
         string filePath = Server.MapPath("~/UploadFiles/");
         if (!System.IO.Directory.Exists(filePath))
         {
             System.IO.Directory.CreateDirectory(filePath);
         }
         string filename = string.Format("盘点管理{0}.xls", DateTime.Now.ToString("yyyyMMddHHmmss"));
         NPOIExcel excel = new NPOIExcel("盘点管理", "盘点单", System.IO.Path.Combine(filePath, filename));
         excel.ToExcel(dt);
         this.ReturnJson.AddProperty("Path", ("/UploadFiles/" + filename).Escape());
     }
     else
     {
         this.ReturnJson.AddProperty("d", "无数据导出!");
     }
     return Content(this.ReturnJson.ToString());
 }
 public ActionResult Audite()
 {
     string OrderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty);
     int Status = WebUtil.GetFormValue<int>("Status", 0);
     string Reason = WebUtil.GetFormValue<string>("Reason", string.Empty);
     CheckStockEntity entity = new CheckStockEntity();
     entity.Status = Status;
     entity.OrderNum = OrderNum;
     entity.AuditUser = this.LoginUser.UserCode;
     entity.Reason = Reason;
     entity.OperateType = (int)EOpType.PC;
     entity.EquipmentNum = string.Empty;
     entity.EquipmentCode = string.Empty;
     Bill<CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder();
     string returnValue = bill.Audite(entity);
     this.ReturnJson.AddProperty("d", returnValue);
     return Content(this.ReturnJson.ToString());
 }
Esempio n. 37
0
        public ActionResult Save()
        {
            int Type = WebUtil.GetFormValue<int>("Type", (int)ECheckType.Local);
            int ProductType = WebUtil.GetFormValue<int>("ProductType", (int)EProductType.Goods);
            string ContractOrder = WebUtil.GetFormValue<string>("ContractOrder", string.Empty);
            DateTime CreateTime = WebUtil.GetFormValue<DateTime>("CreateTime", DateTime.Now);
            string Remark = WebUtil.GetFormValue<string>("Remark", string.Empty);
            string TargetNum = WebUtil.GetFormValue<string>("TargetNum", string.Empty);
            CheckStockEntity entity = new CheckStockEntity();
            string orderNum = SequenceProvider.GetSequence(typeof(CheckStockEntity));
            entity.OrderNum = orderNum;
            entity.Type = Type;
            entity.ProductType = ProductType;
            entity.ContractOrder = ContractOrder;
            entity.Status = (int)EAudite.Wait;
            entity.IsDelete = (int)EIsDelete.NotDelete;
            entity.CreateTime = CreateTime;
            entity.CreateUser = this.LoginUser.UserCode;
            entity.OperateType = (int)EOpType.PC;
            entity.IsComplete = (int)EBool.No;
            entity.Remark = Remark;
            entity.StorageNum = this.DefaultStore;

            List<ProductEntity> ListProducts = Session[CacheKey.JOOSHOW_CHECKDETAIL_CACHE] as List<ProductEntity>;
            ListProducts = ListProducts.IsNull() ? new List<ProductEntity>() : ListProducts;

            List<CheckStockInfoEntity> listDetail = new List<CheckStockInfoEntity>();
            string storageNum = this.DefaultStore;
            foreach (ProductEntity key in ListProducts)
            {
                CheckStockInfoEntity detail = new CheckStockInfoEntity();
                detail.OrderNum = orderNum;
                detail.TargetNum = key.SnNum;
                detail.StorageNum = storageNum;
                detail.CreateTime = DateTime.Now;
                listDetail.Add(detail);
            }

            Bill<CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder();
            string returnValue = bill.Create(entity, listDetail);
            if (returnValue == EnumHelper.GetEnumDesc<EReturnStatus>(EReturnStatus.Success))
            {
                this.ReturnJson.AddProperty("Key", "1000");
                this.ReturnJson.AddProperty("Value", "盘点单创建成功");
            }
            return Content(this.ReturnJson.ToString());
        }
Esempio n. 38
0
        public ActionResult Edit()
        {
            string orderNum = WebUtil.GetQueryStringValue<string>("OrderNum", string.Empty);
            Bill<CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder();
            CheckStockEntity entity = new CheckStockEntity();
            entity.OrderNum = orderNum;
            entity = bill.GetOrder(entity);
            if (entity.IsNull())
            {
                return Redirect("/Check/Product/List");
            }
            string checkType = EnumHelper.GetOptions<ECheckType>(entity.Type);
            ViewBag.CheckType = checkType;
            ViewBag.ProductType = EnumHelper.GetOptions<EProductType>(entity.ProductType);
            ViewBag.Entity = entity;
            CheckStockInfoEntity info = new CheckStockInfoEntity();
            info.OrderNum = orderNum;
            List<CheckStockInfoEntity> list = bill.GetOrderDetail(info);

            List<ProductEntity> ListProducts = new List<ProductEntity>();
            List<ProductEntity> ListSource = new ProductProvider().GetListByCache();
            if (!list.IsNullOrEmpty())
            {
                Parallel.ForEach(list, item =>
                {
                    if (ListSource.Exists(a => a.SnNum == item.TargetNum))
                    {
                        ProductEntity target = ListSource.FirstOrDefault(a => a.SnNum == item.TargetNum);
                        ListProducts.Add(target);
                    }
                });
            }
            Session[CacheKey.JOOSHOW_CHECKDETAIL_CACHE] = ListProducts;
            return View();
        }