Example #1
0
 public NewsfeedEditorController(IOptions <StorageSettings> options, ITextAssetsRepository textRepository,
                                 INewsfeedRepository repo)
 {
     _repo          = repo;
     _textRepo      = textRepository;
     _storageFacade = new StorageFacade(options);
 }
        private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            DataGridItem item     = this.DataGrid1.SelectedItem;
            string       strAssID = item.Cells[0].Text.Trim();
            OperLog      operLog  = new OperLog();

            operLog.cnvcOperType = "添加关联分货单";
            operLog.cnvcOperID   = this.oper.strLoginID;
            operLog.cnvcDeptID   = this.oper.strDeptID;
            StorageFacade sto = new StorageFacade();
            int           ret = sto.AddDeptStorageEnterDetail(operLog, this.txtRdID.Text.Trim(), strAssID, this.ddlDept.SelectedValue);

            if (ret > 0)
            {
                this.Popup("添加关联分货单成功!");
            }
            else
            {
                this.Popup("添加关联分货单失败!");
            }

            this.DataGrid1.DataSource = null;
            this.DataGrid1.DataBind();
            this.DBBind();
        }
Example #3
0
        private void btnCheckOk_Click(object sender, System.EventArgs e)
        {
            if (this.txtCheckNo.Text.Trim() == "" || this.txtCheckNo.Text.Trim().Length != 8)
            {
                this.Popup("盘点序号不正确,请重试!");
                return;
            }
            if (this.Datagrid2.Items.Count <= 0)
            {
                this.Popup("无任何盘点存货记录!");
                return;
            }
            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            ol.cnvcOperType = "仓库库存清零盘点";
            ol.cnvcOperID   = this.oper.strLoginID;
            ol.cnvcDeptID   = this.oper.strDeptID;

            StorageFacade sto = new StorageFacade();
            int           ret = sto.StorageCheckClearConfirm(ol, this.txtCheckNo.Text.Trim(), this.ddlWhouse.SelectedValue, this.ddlDept.SelectedValue, this.oper.strOperName);

            if (ret > 0)
            {
                this.Popup("仓库库存盘点确认更新库存成功!");
                this.DBBind();
            }
            else
            {
                this.Popup("仓库库存盘点确认更新库存失败!");
            }
        }
        private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            DataGridItem item      = this.DataGrid1.SelectedItem;
            string       strselsql = "select " + this.txtRdID.Text.Trim() + ",'" + item.Cells[1].Text.Trim() + "'," + item.Cells[0].Text.Trim() + ",cnvcProviderID,cnvcInvCode,0,cnnPrice,0,0,cnvcGroupCode,cnvcComunitCode,cnvcBatch,'0','',cndMdate,cnnMassDate,cnvcMassUnit,cndExpDate";

            strselsql += " from tbRdRecordDetail where cnnAutoID=" + item.Cells[0].Text.Trim() + " and cnvcPoID='" + item.Cells[1].Text.Trim() + "' and cnvcProviderID='" + item.Cells[4].Text.Trim() + "' and cnvcInvCode='" + item.Cells[6].Text.Trim() + "'";
            OperLog operLog = new OperLog();

            operLog.cnvcOperType = "添加采购退货品";
            operLog.cnvcOperID   = this.oper.strLoginID;
            operLog.cnvcDeptID   = this.oper.strDeptID;
            StorageFacade sto = new StorageFacade();
            int           ret = sto.AddPoStockReturnDetail(operLog, strselsql);

            if (ret > 0)
            {
                this.Popup("添加退货品成功!");
            }
            else
            {
                this.Popup("添加退货品失败!");
            }

            this.DataGrid1.DataSource = null;
            this.DataGrid1.DataBind();
            this.DBBind();
        }
Example #5
0
        private void Awake()
        {
            DontDestroyOnLoad(gameObject);

            game       = GetComponent <Game>();
            level      = GetComponent <Level>();
            levelFiles = GetComponent <LevelFiles>();

            IStorage storage = new StorageFacade();

            game.Init(storage);
            level.Init(storage);
            levelFiles.Init(storage);

            eventsCentre = EventsCentre.GetInstance();
            eventsCentre.Subscribe(new Topic("GameStart"), this, NewGame);
            eventsCentre.Subscribe(new Topic("GameRestart"), this, RestartGame);
            eventsCentre.Subscribe(new Topic("GameExit"), this, ExitGame);

            eventsCentre.Subscribe(new Topic("LevelSave"), this, SaveLevel);
            eventsCentre.Subscribe(new Topic("LevelEnd"), this, NextLevel);

            eventsCentre.Subscribe(new Topic("FileDelete"), this);
            eventsCentre.Subscribe(new Topic("FileOverride"), this);
            eventsCentre.Subscribe(new Topic("FileLoad"), this);

            eventsCentre.Subscribe(new Topic("UnlockedLevelsCountRequest"), this);
        }
Example #6
0
 private static IStorageFacade CreateStorageFacade(StorageAccountConfiguration description)
 {
     if (!string.IsNullOrWhiteSpace(description.Token))
     {
         return(StorageFacade.FromToken(
                    description.Name,
                    description.Container,
                    description.Folder,
                    description.Token));
     }
     else if (!string.IsNullOrWhiteSpace(description.TokenPath))
     {
         throw new NotImplementedException();
     }
     else if (!string.IsNullOrWhiteSpace(description.Key))
     {
         return(StorageFacade.FromKey(
                    description.Name,
                    description.Container,
                    description.Folder,
                    description.Key));
     }
     else if (!string.IsNullOrWhiteSpace(description.KeyPath))
     {
         throw new NotImplementedException();
     }
     else
     {
         throw new NotSupportedException();
     }
 }
Example #7
0
        public bool Delete(int id)
        {
            var technique = _context.Techniques.Where(t => t.ID == id).Include(t => t.Name).FirstOrDefault();

            if (technique != null)
            {
                try
                {
                    var storageFacade = new StorageFacade(_storageSettings);
                    var imageUris     = _context.ArtPieces.Where(ap => ap.Technique.ID == technique.ID).Select(ap => ap.ImageUri).ToList();
                    var asset         = _context.TextAssets.Where(ta => ta.Id == technique.Name.Id).FirstOrDefault();
                    _context.Techniques.Remove(technique);
                    if (asset != null)
                    {
                        _context.TextAssets.Remove(asset);
                    }
                    foreach (var imageUri in imageUris)
                    {
                        storageFacade.DeleteImageBlob(imageUri);
                    }
                    _context.SaveChanges();
                    return(true);
                }
                catch (Exception ex)
                {
                    if (ex is DbUpdateException || ex is DbUpdateConcurrencyException)
                    {
                        return(false);
                    }
                    throw;
                }
            }
            return(false);
        }
        private void Datagrid2_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            if (e.CommandName == "ReStop")
            {
                string strAutoID = e.Item.Cells[0].Text.Trim();
                if (strAutoID == "")
                {
                    this.Popup("库存记录标识错误,请重试!");
                    return;
                }
                Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
                ol.cnvcOperType = "库存解冻";
                ol.cnvcOperID   = this.oper.strLoginID;
                ol.cnvcDeptID   = this.oper.strDeptID;

                StorageFacade sto = new StorageFacade();
                int           ret = sto.UpdateCurrentStockReStop(ol, strAutoID);
                if (ret > 0)
                {
                    this.Popup("库存解冻成功!");
                    this.DBBind();
                }
                else
                {
                    this.Popup("库存解冻失败!");
                }
            }
        }
Example #9
0
 public GalleryEditorController(IOptions <StorageSettings> storageSettings, IGalleryRepository repo,
                                ITextAssetsRepository textRepo, ITechniqueRepository techniqueRepo)
 {
     _galleryRepo     = repo;
     _techniqueRepo   = techniqueRepo;
     _storageSettings = storageSettings;
     _textRepo        = textRepo;
     _storageFacade   = new StorageFacade(storageSettings);
     _factory         = new ArtPieceFactory(_galleryRepo, _textRepo, _techniqueRepo);
 }
        private void btAdd_Click(object sender, System.EventArgs e)
        {
            strArriveDate = Request.Form["txtArvDate"].ToString();
            if (strArriveDate == "" || strArriveDate == null)
            {
                this.Popup("到货时间不能为空,请重新选择时间!");
                return;
            }
            Entity.RdRecord rd = new RdRecord();
            rd.cnvcCode      = this.txtEnterCode.Text.Trim();
            rd.cnvcRdCode    = "RD001";
            rd.cnvcRdFlag    = "0";
            rd.cnvcIsLsQuery = this.ddlIsLsQuery.SelectedValue;
            rd.cnvcWhCode    = this.ddlWhouse.SelectedValue;
            rd.cnvcDepID     = this.ddlDeptID.SelectedValue;
            rd.cnvcOperName  = this.oper.strOperName;
            rd.cnvcCusCode   = "";
            //rd.cnvcProBatch="";
            rd.cnvcComments = this.txtComments.Text.Trim();
            rd.cnvcMaker    = this.oper.strOperName;
            //rd.cnvcMPoCode="";
            rd.cnvcShipAddress = this.txtShipAddress.Text.Trim();
            rd.cndARVDate      = DateTime.Parse(strArriveDate);
            rd.cnvcARVAddress  = this.txtArvAddress.Text.Trim();
            rd.cnvcState       = "0";

            if (rd.cnvcCode == "" || rd.cnvcCode.Length != 13)
            {
                this.Popup("采购入库单号不正确!");
                return;
            }
            if (rd.cnvcWhCode == "")
            {
                this.Popup("仓库不能为空!");
                return;
            }

            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            ol.cnvcOperType = "添加采购入库主单";
            ol.cnvcOperID   = this.oper.strLoginID;
            ol.cnvcDeptID   = this.oper.strDeptID;

            StorageFacade sto = new StorageFacade();
            int           ret = sto.AddRdRecordCom("RD001", ol, rd);

            if (ret > 0)
            {
                this.Popup("添加采购入库单内容成功!");
            }
            else
            {
                this.Popup("添加采购入库单内容失败!");
            }
        }
Example #11
0
        private void btMod_Click(object sender, System.EventArgs e)
        {
            strLostDate = Request.Form["txtLostDate"].ToString();
            if (strLostDate == "" || strLostDate == null)
            {
                this.Popup("损耗时间不能为空,请重新选择时间!");
                return;
            }
            if (this.txtAddCount.Text.Trim() == "" || this.txtReduceCount.Text.Trim() == "")
            {
                this.Popup("调增量和调减量不能为空!");
                return;
            }
            Entity.LostSerial ls = new LostSerial();
            ls.cnnLostSerialNo = int.Parse(this.txtSerialNo.Text.Trim());
            ls.cnnAddCount     = Math.Round(decimal.Parse(this.txtAddCount.Text.Trim()), 2);
            ls.cnnReduceCount  = Math.Round(decimal.Parse(this.txtReduceCount.Text.Trim()), 2);
            ls.cndLostDate     = DateTime.Parse(strLostDate);
            ls.cnvcComments    = this.txtComments.Text.Trim();
            ls.cnvcOperID      = this.oper.strLoginID;
            if (ls.cnnLostSerialNo.ToString() == "")
            {
                this.Popup("损耗流水不正确!");
                return;
            }
            string strsql = "select count(*) from tbLostSerial a,tbCurrentStock b,tbComputationUnit c where a.cnnLostSerialNo=" + ls.cnnLostSerialNo.ToString() + " and a.cnvcInvCode=b.cnvcInvCode and a.cnvcWhCode=b.cnvcWhCode";

            strsql += " and convert(char(8),a.cndMdate,112)=convert(char(8),b.cndMdate,112) and convert(char(8),a.cndExpDate,112)=convert(char(8),b.cndExpDate,112)";
            strsql += " and a.cnvcComunitCode=c.cnvcComunitCode and a.cnnLostCount+a.cnnAddCount-a.cnnReduceCount>(b.cnnQuantity*c.cniChangRate)";
            DataTable dterrcount = Helper.Query(strsql);

            if (dterrcount.Rows.Count > 0)
            {
                this.Popup("损耗数量不能大于库存数量!");
                return;
            }

            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            ol.cnvcOperType = "修改过期损耗";
            ol.cnvcOperID   = this.oper.strLoginID;
            ol.cnvcDeptID   = this.oper.strDeptID;

            StorageFacade sto = new StorageFacade();
            int           ret = sto.UpdateLostSerial(ol, ls);

            if (ret > 0)
            {
                this.Popup("修改过期损耗成功!");
            }
            else
            {
                this.Popup("修改过期损耗失败!");
            }
        }
Example #12
0
        private void Datagrid2_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            if (e.CommandName == "SelectEnter")
            {
                if (e.Item.Cells[15].Text.Trim() == "" || e.Item.Cells[15].Text.Trim() == "&nbsp;")
                {
                    this.Popup("请填写生产日期!");
                    return;
                }
                if (e.Item.Cells[17].Text.Trim() == "" || e.Item.Cells[17].Text.Trim() == "&nbsp;")
                {
                    this.Popup("请填写过期日期!");
                    return;
                }
                string strWhcode          = this.ddlWhouse.SelectedValue;
                Entity.RdRecordDetail rrd = new RdRecordDetail();
                rrd.cnnAutoID   = int.Parse(e.Item.Cells[0].Text.Trim());
                rrd.cnvcPOID    = e.Item.Cells[2].Text.Trim();
                rrd.cnnRdID     = int.Parse(this.txtRdID.Text.Trim());
                rrd.cndMdate    = DateTime.Parse(e.Item.Cells[15].Text.Trim());
                rrd.cndExpDate  = DateTime.Parse(e.Item.Cells[17].Text.Trim());
                rrd.cnvcInvCode = e.Item.Cells[4].Text.Trim();

                if (strWhcode == "")
                {
                    this.Popup("仓库不能为空!");
                    return;
                }
//				DataTable dtsum=(DataTable)Session["sumenter"];
//				if(dtsum==null||dtsum.Rows.Count<=0)
//				{
//					this.Popup("该采购入库单无任何货品记录,请先关联采购订单!");
//					return;
//				}

                Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
                ol.cnvcOperType = "采购入库单入库";
                ol.cnvcOperID   = this.oper.strLoginID;
                ol.cnvcDeptID   = this.oper.strDeptID;

                StorageFacade sto = new StorageFacade();
                int           ret = sto.PoStockEnterExecEntering(ol, strWhcode, rrd);
                if (ret > 0)
                {
                    this.Popup("采购入库单入库成功!");
                    this.DBBind();
                }
                else
                {
                    this.Popup("采购入库单入库失败!");
                }
            }
        }
Example #13
0
        private void btAdd_Click(object sender, System.EventArgs e)
        {
            strArriveDate = Request.Form["txtArvDate"].ToString();
            if (strArriveDate == "" || strArriveDate == null)
            {
                this.Popup("到货时间不能为空,请重新选择时间!");
                this.ClientScript.RegisterStartupScript(this.GetType(), "hide", "<script lanaguage=javascript>ShowHide('1','none');</script>");
                return;
            }
            Entity.RdRecord rd = new RdRecord();
            rd.cnvcCode        = this.txtEnterCode.Text.Trim();
            rd.cnvcRdCode      = "RD002";
            rd.cnvcRdFlag      = "1";
            rd.cnvcWhCode      = this.ddlWhouse.SelectedValue;
            rd.cnvcDepID       = this.ddlDeptID.SelectedValue;
            rd.cnvcOperName    = this.oper.strOperName;
            rd.cnvcComments    = this.txtComments.Text.Trim();
            rd.cnvcMaker       = this.oper.strOperName;
            rd.cnvcShipAddress = this.txtShipAddress.Text.Trim();
            rd.cndARVDate      = DateTime.Parse(strArriveDate);
            rd.cnvcARVAddress  = this.txtArvAddress.Text.Trim();
            rd.cnvcState       = "0";

            if (rd.cnvcCode == "" || rd.cnvcCode.Length != 13)
            {
                this.Popup("采购退货单号不正确!");
                return;
            }
            if (rd.cnvcWhCode == "")
            {
                this.Popup("仓库不能为空!");
                return;
            }

            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            ol.cnvcOperType = "添加采购退货主单";
            ol.cnvcOperID   = this.oper.strLoginID;
            ol.cnvcDeptID   = this.oper.strDeptID;

            StorageFacade sto = new StorageFacade();
            int           ret = sto.AddRdRecordCom("RD002", ol, rd);

            if (ret > 0)
            {
                this.Popup("添加采购退货单内容成功!");
            }
            else
            {
                this.Popup("添加采购退货单内容失败!");
            }
        }
        private void btnRefreshSTBA_Click(object sender, System.EventArgs e)
        {
            StorageFacade sto = new StorageFacade();
            int           ret = sto.CreateStorageBalance();

            if (ret > 0)
            {
                this.Popup("重新刷新库存平衡关系成功!");
            }
            else
            {
                this.Popup("重新刷新库存平衡关系失败!");
            }
        }
        private void Datagrid2_UpdateCommand(object source, DataGridCommandEventArgs e)
        {
            if (((TextBox)e.Item.Cells[11].Controls[0]).Text.Trim() == "" || !this.JudgeIsNum(((TextBox)e.Item.Cells[11].Controls[0]).Text.Trim()))
            {
                this.Popup("入库数量不能为空且必须是数字!");
                return;
            }
            if (((TextBox)e.Item.Cells[10].Controls[0]).Text.Trim() == "" || !this.JudgeIsNum(((TextBox)e.Item.Cells[10].Controls[0]).Text.Trim()))
            {
                this.Popup("损耗数量不能为空且必须是数字!");
                return;
            }
            Entity.RdRecordDetail rrd = new RdRecordDetail();
            rrd.cnnAutoID   = int.Parse(e.Item.Cells[0].Text.Trim());
            rrd.cnnQuantity = Math.Round(decimal.Parse(((TextBox)e.Item.Cells[11].Controls[0]).Text.Trim()), 2);
            decimal dlostcount = Math.Round(decimal.Parse(((TextBox)e.Item.Cells[10].Controls[0]).Text.Trim()), 2);
            decimal doutcount  = Math.Round(decimal.Parse(e.Item.Cells[9].Text.Trim()), 2);

            if (rrd.cnnAutoID.ToString() == "" || rrd.cnnAutoID == 0)
            {
                this.Popup("分货入库单子表标识不正确!");
                return;
            }
            if (doutcount != rrd.cnnQuantity + dlostcount)
            {
                this.Popup("损耗数量+入库数量不等于分货数量");
                return;
            }
            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            ol.cnvcOperType = "修改分货入库子表";
            ol.cnvcOperID   = this.oper.strLoginID;
            ol.cnvcDeptID   = this.oper.strDeptID;

            StorageFacade sto = new StorageFacade();
            int           ret = sto.UpdateDeptStorageEnterDetail(ol, rrd, dlostcount);

            if (ret > 0)
            {
                this.Popup("修改分货入库单子表明细成功!");
                this.DBBind();
            }
            else
            {
                this.Popup("修改分货入库单子表明细失败!");
            }
        }
Example #16
0
        private void btConfirm_Click(object sender, System.EventArgs e)
        {
            if (this.txtSerialNo.Text.Trim() == "" || this.txtInvCode.Text.Trim() == "")
            {
                this.Popup("损耗流水不正确!");
                return;
            }

            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            ol.cnvcOperType = "确认过期损耗";
            ol.cnvcOperID   = this.oper.strLoginID;
            ol.cnvcDeptID   = this.oper.strDeptID;

            string strsql = "select a.cnnLostSerialNo from tbLostSerial a,tbCurrentStock b,tbComputationUnit c where a.cnnLostSerialNo=" + this.txtSerialNo.Text.Trim() + " and a.cnvcInvCode=b.cnvcInvCode and a.cnvcWhCode=b.cnvcWhCode";

            strsql += " and convert(char(8),a.cndMdate,112)=convert(char(8),b.cndMdate,112) and convert(char(8),a.cndExpDate,112)=convert(char(8),b.cndExpDate,112)";
            strsql += " and a.cnvcComunitCode=c.cnvcComunitCode and a.cnnLostCount+a.cnnAddCount-a.cnnReduceCount>(b.cnnQuantity*c.cniChangRate)";
            DataTable dterrcount = Helper.Query(strsql);

            if (dterrcount.Rows.Count > 0)
            {
                this.Popup("损耗数量大于当前库存量,可能是库存已经有变动,请检查修改损耗数量!");
                return;
            }

            StorageFacade sto = new StorageFacade();
            int           ret = sto.ConfirmLostSerial(ol, this.txtSerialNo.Text.Trim());

            if (ret > 0)
            {
                this.Popup("确认过期损耗成功!");
                this.txtAddCount.Enabled    = false;
                this.txtReduceCount.Enabled = false;
                this.txtComments.Enabled    = false;
                this.Button1.Enabled        = false;
                this.btMod.Enabled          = false;
                this.btConfirm.Visible      = false;
            }
            else
            {
                this.Popup("确认过期损耗失败!");
            }
        }
        private void btnInvAccount_Click(object sender, System.EventArgs e)
        {
            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            ol.cnvcOperType = "原材料成本核算";
            ol.cnvcOperID   = this.oper.strLoginID;
            ol.cnvcDeptID   = this.oper.strDeptID;

            StorageFacade sto = new StorageFacade();
            int           ret = sto.InventoryCostAccount(ol, "mate");

            if (ret > 0)
            {
                this.Popup("原材料成本核算成功!");
            }
            else
            {
                this.Popup("原材料成本核算失败!");
            }
        }
Example #18
0
        public async Task <ActionResult> Edit(EditSquareSetPieceViewModel squareSetPieceViewModel)
        {
            if (ModelState.IsValid)
            {
                // upload the new image
                var storage = new StorageFacade();
                var image   = squareSetPieceViewModel.UpdatedImage;
                var url     = storage.Store(image.FileName, image.InputStream, User.Identity.GetUserId());

                // update the db
                var setPiece = await _db.SquareSetPieces.FirstAsync(o => o.Id == squareSetPieceViewModel.Id);

                setPiece.ImageUrl = url;

                await _db.SaveChangesAsync();

                return(RedirectToAction("Details", new { id = squareSetPieceViewModel.Id }));
            }

            return(View(squareSetPieceViewModel));
        }
        private void UploadImages(ISquareSetViewModel squareSetViewModel)
        {
            if (squareSetViewModel.Images != null && squareSetViewModel.Images.Any())
            {
                var storage = new StorageFacade();
                foreach (var image in squareSetViewModel.Images)
                {
                    if (image != null && image.ContentLength > 0)
                    {
                        var url            = storage.Store(image.FileName, image.InputStream, User.Identity.GetUserId());
                        var squareSetPiece = new SquareSetPiece
                        {
                            SquareSetId = squareSetViewModel.Id,
                            ImageUrl    = url
                        };

                        _db.SquareSetPieces.Add(squareSetPiece);
                    }
                }
            }
        }
        private void btMod_Click(object sender, System.EventArgs e)
        {
            strArriveDate = Request.Form["txtArvDate"].ToString();
            if (strArriveDate == "" || strArriveDate == null)
            {
                this.Popup("到货时间不能为空,请重新选择时间!");
                return;
            }
            Entity.RdRecord rdrm = new RdRecord();
            rdrm.cnnRdID         = int.Parse(this.txtRdID.Text.Trim());
            rdrm.cnvcIsLsQuery   = this.ddlIsLsQuery.SelectedValue;
            rdrm.cndARVDate      = DateTime.Parse(strArriveDate);
            rdrm.cnvcShipAddress = this.txtShipAddress.Text.Trim();
            rdrm.cnvcARVAddress  = this.txtArvAddress.Text.Trim();
            rdrm.cnvcComments    = this.txtComments.Text.Trim();
            rdrm.cnvcModer       = oper.strOperName;

            if (rdrm.cnnRdID.ToString() == "" || rdrm.cnnRdID == 0)
            {
                this.Popup("采购入库单主表标识不正确!");
                return;
            }

            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            ol.cnvcOperType = "修改采购入库主单";
            ol.cnvcOperID   = this.oper.strLoginID;
            ol.cnvcDeptID   = this.oper.strDeptID;

            StorageFacade sto = new StorageFacade();
            int           ret = sto.UpdateRdRecordCom("RD001", ol, rdrm);

            if (ret > 0)
            {
                this.Popup("修改采购入库单内容成功!");
            }
            else
            {
                this.Popup("修改采购入库单内容失败!");
            }
        }
        private void btnCheckOk_Click(object sender, System.EventArgs e)
        {
            DataTable dt = (DataTable)Session["checktomod"];

            if (this.ddlDayCheckNo.SelectedValue == "")
            {
                this.Popup("盘点序号不正确,可能盘点记录已经不是当日操作记录!");
                return;
            }
            if (dt.Rows.Count <= 0)
            {
                this.Popup("无任何盘点存货记录!");
                return;
            }
            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            ol.cnvcOperType = "仓库库存盘点";
            ol.cnvcOperID   = this.oper.strLoginID;
            ol.cnvcDeptID   = this.oper.strDeptID;

            DataTable dtre = Helper.Query("select count(*) from tbStorageCheckLog where cnvcCheckNo='" + this.ddlDayCheckNo.SelectedValue + "' and (cndMdate is null or cndExpDate is null)");

            if (dtre.Rows[0][0].ToString() != "0")
            {
                this.Popup("盘点存货中存在生产日期或过期日期为空的记录,请先修改!");
                return;
            }
            StorageFacade sto = new StorageFacade();
            int           ret = sto.StorageCheckLogConfirm(ol, this.ddlDayCheckNo.SelectedValue, this.ddlWhouse.SelectedValue, this.ddlDept.SelectedValue);

            if (ret > 0)
            {
                this.Popup("仓库库存盘点确认更新库存成功!");
                this.DBBind();
            }
            else
            {
                this.Popup("仓库库存盘点确认更新库存失败!");
            }
        }
        private void Datagrid2_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            string strRdID    = e.Item.Cells[0].Text.Trim();
            string strInvCode = e.Item.Cells[1].Text.Trim();

            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            ol.cnvcOperType = "删除调拨单子表";
            ol.cnvcOperID   = this.oper.strLoginID;
            ol.cnvcDeptID   = this.oper.strDeptID;

            StorageFacade sto = new StorageFacade();
            int           ret = sto.DeleteRdRecordMoveDetail(ol, strRdID, strInvCode);

            if (ret > 0)
            {
                this.Popup("删除调拨单子表明细成功!");
                this.DBBind();
            }
            else
            {
                this.Popup("删除调拨单子表明细失败!");
            }
        }
        private void Datagrid2_UpdateCommand(object source, DataGridCommandEventArgs e)
        {
            decimal EnterQuantity = Math.Round(decimal.Parse(e.Item.Cells[8].Text.Trim()), 2);

            Entity.RdRecordDetail rrd = new RdRecordDetail();
            rrd.cnnAutoID   = int.Parse(e.Item.Cells[0].Text.Trim());
            rrd.cnnQuantity = Math.Round(decimal.Parse(((TextBox)e.Item.Cells[9].Controls[0]).Text.Trim()), 2);
            rrd.cnvcCommens = ((TextBox)e.Item.Cells[11].Controls[0]).Text.Trim();
            if (rrd.cnnQuantity > EnterQuantity)
            {
                this.Popup("采购退货数量不能大于原入库数量!");
                return;
            }
            if (rrd.cnnAutoID.ToString() == "" || rrd.cnnAutoID == 0)
            {
                this.Popup("采购退货单子表标识不正确!");
                return;
            }

            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            ol.cnvcOperType = "修改采购退货子表";
            ol.cnvcOperID   = this.oper.strLoginID;
            ol.cnvcDeptID   = this.oper.strDeptID;

            StorageFacade sto = new StorageFacade();
            int           ret = sto.UpdatePoStockReturnDetail(ol, rrd);

            if (ret > 0)
            {
                this.Popup("修改采购退货单子表明细成功!");
                this.DBBind();
            }
            else
            {
                this.Popup("修改采购退货单子表明细失败!");
            }
        }
Example #24
0
        public async Task <ActionResult> Create(CreateSquareSetPieceViewModel squareSetPieceViewModel)
        {
            if (ModelState.IsValid)
            {
                var storage = new StorageFacade();
                foreach (var image in squareSetPieceViewModel.Images)
                {
                    var url            = storage.Store(image.FileName, image.InputStream, User.Identity.GetUserId());
                    var squareSetPiece = new SquareSetPiece
                    {
                        SquareSetId = squareSetPieceViewModel.SquareSetId,
                        ImageUrl    = url
                    };

                    _db.SquareSetPieces.Add(squareSetPiece);
                }

                await _db.SaveChangesAsync();

                return(RedirectToAction("Edit", "SquareSets", new { id = squareSetPieceViewModel.SquareSetId }));
            }

            return(View(squareSetPieceViewModel));
        }
        private void btEnterComf_Click(object sender, System.EventArgs e)
        {
            string strWhcode = this.ddlWhouse.SelectedValue;
            string strRdid   = this.txtRdID.Text.Trim();

            if (strWhcode == "")
            {
                this.Popup("仓库不能为空!");
                return;
            }
            DataTable dtdetail = (DataTable)Session["asdetailtomod"];

            if (dtdetail == null || dtdetail.Rows.Count <= 0)
            {
                this.Popup("该分货入库单无任何货品记录,请先关联生产分货单!");
                return;
            }

            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            ol.cnvcOperType = "分货入库单入库";
            ol.cnvcOperID   = this.oper.strLoginID;
            ol.cnvcDeptID   = this.oper.strDeptID;

            StorageFacade sto = new StorageFacade();
            int           ret = sto.DeptStorageEnterExecEntering(ol, strWhcode, dtdetail, strRdid, this.ddlDept.SelectedValue);

            if (ret > 0)
            {
                this.Popup("分货入库单入库成功!");
                this.DBBind();
            }
            else
            {
                this.Popup("分货入库单入库失败!");
            }
        }
        private void btEnterComf_Click(object sender, System.EventArgs e)
        {
            string strWhcode = this.ddlWhouse.SelectedValue;
            string strRdid   = this.txtRdID.Text.Trim();

            if (strWhcode == "")
            {
                this.Popup("仓库不能为空!");
                return;
            }
            DataTable dtsum = (DataTable)Session["sumenter"];

            if (dtsum == null || dtsum.Rows.Count <= 0)
            {
                this.Popup("该采购退货单无任何货品记录,请先录入要退的货品!");
                return;
            }

            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            ol.cnvcOperType = "采购退货单出库";
            ol.cnvcOperID   = this.oper.strLoginID;
            ol.cnvcDeptID   = this.oper.strDeptID;

            StorageFacade sto = new StorageFacade();
            int           ret = sto.PoStockReturnExecReturning(ol, strWhcode, dtsum, strRdid);

            if (ret > 0)
            {
                this.Popup("采购退货单出库成功!");
                this.DBBind();
            }
            else
            {
                this.Popup("采购退货单出库失败!");
            }
        }
        private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            DataGridItem item = this.DataGrid1.SelectedItem;

            if (this.txtCheckCount.Text.Trim() == "" || !this.JudgeIsNum(this.txtCheckCount.Text.Trim()))
            {
                this.Popup("盘点存量不能为空且必须是数字!");
                return;
            }

            StorageCheckLog scl = new StorageCheckLog();

            scl.cnvcDeptID    = this.ddlDept.SelectedValue;
            scl.cnvcWhCode    = this.ddlWhouse.SelectedValue;
            scl.cnvcInvCode   = item.Cells[0].Text.Trim();
            scl.cnnSysCount   = Math.Round(decimal.Parse(item.Cells[5].Text.Trim()), 2);
            scl.cnnCheckCount = Math.Round(decimal.Parse(this.txtCheckCount.Text.Trim()), 2);
            scl.cnvcUnitCode  = item.Cells[2].Text.Trim();
            scl.cnvcOperName  = this.oper.strOperName;
            scl.cnvcFlag      = "0";
            string strMdate   = "";
            string strExpdate = "";

            if (item.Cells[6].Text.Trim() != "")
            {
                scl.cndMdate = DateTime.Parse(item.Cells[6].Text.Trim());
                strMdate     = scl.cndMdate.Year.ToString();
                if (scl.cndMdate.Month < 10)
                {
                    strMdate += "0" + scl.cndMdate.Month.ToString();
                }
                else
                {
                    strMdate += scl.cndMdate.Month.ToString();
                }
                if (scl.cndMdate.Day < 10)
                {
                    strMdate += "0" + scl.cndMdate.Day.ToString();
                }
                else
                {
                    strMdate += scl.cndMdate.Day.ToString();
                }
            }
            if (item.Cells[7].Text.Trim() != "")
            {
                scl.cndExpDate = DateTime.Parse(item.Cells[7].Text.Trim());
                strExpdate     = scl.cndExpDate.Year.ToString();
                if (scl.cndExpDate.Month < 10)
                {
                    strExpdate += "0" + scl.cndExpDate.Month.ToString();
                }
                else
                {
                    strExpdate += scl.cndExpDate.Month.ToString();
                }
                if (scl.cndExpDate.Day < 10)
                {
                    strExpdate += "0" + scl.cndExpDate.Day.ToString();
                }
                else
                {
                    strExpdate += scl.cndExpDate.Day.ToString();
                }
            }
            string strcheckno = "";

            string strisexist = "";

            if (strMdate == "" && strExpdate == "")
            {
                strisexist = Helper.Query("select count(*) from tbStorageCheckLog where cnvcWhCode='" + scl.cnvcWhCode + "' and cnvcInvCode='" + scl.cnvcInvCode + "' and cnvcFlag='0' and cnvcCheckNo like convert(char(8),getdate(),112)+'%'").Rows[0][0].ToString();
            }
            else
            {
                strisexist = Helper.Query("select count(*) from tbStorageCheckLog where cnvcWhCode='" + scl.cnvcWhCode + "' and cnvcInvCode='" + scl.cnvcInvCode + "' and cnvcFlag='0' and cnvcCheckNo like convert(char(8),getdate(),112)+'%' and convert(char(8),cndMdate,112)='" + strMdate + "' and convert(char(8),cndExpDate,112)='" + strExpdate + "'").Rows[0][0].ToString();
            }
            if (strisexist != "0")
            {
                this.Popup("本仓库的" + item.Cells[1].Text.Trim() + "在今日内还有未确认的盘点记录,不可添加!");
                return;
            }
            else
            {
                StorageFacade sto = new StorageFacade();
                int           ret = sto.AddStorageCheckLog(scl, this.txtCheckNo.Text.Trim(), out strcheckno);
                if (ret > 0)
                {
                    this.Popup("添加盘点存货成功!");
                    this.ddlState.SelectedIndex = this.ddlState.Items.IndexOf(this.ddlState.Items.FindByValue("0"));
                    DataTable dtcheckno = Helper.Query("select distinct cnvcCheckNo as cnvcCode,cnvcCheckNo as cnvcName from tbStorageCheckLog where cnvcWhCode='" + this.ddlWhouse.SelectedValue + "' and cnvcCheckNo like '" + this.txtCheckNo.Text.Trim() + "%'");
                    this.FillDropDownList(dtcheckno, this.ddlDayCheckNo);
                    this.ddlDayCheckNo.SelectedIndex = this.ddlDayCheckNo.Items.IndexOf(this.ddlDayCheckNo.Items.FindByValue(strcheckno));
                    this.ddlDept.Enabled             = false;
                    this.ddlWhouse.Enabled           = false;
                    this.ddlDayCheckNo.Enabled       = false;
                    this.ddlState.Enabled            = false;
                    this.btnCheckOk.Enabled          = true;
                }
                else
                {
                    if (ret < 0)
                    {
                        this.Popup("该仓库在盘点序号“" + strcheckno + "”中已经有此存货的盘点记录,请重试!");
                    }
                    else
                    {
                        this.Popup("添加盘点存货失败!");
                    }
                }

                this.DataGrid1.DataSource = null;
                this.DataGrid1.DataBind();
                this.DBBind();
            }
        }
Example #28
0
        private void btAdd_Click(object sender, System.EventArgs e)
        {
            strLostDate = Request.Form["txtLostDate"].ToString();
            if (strLostDate == "" || strLostDate == null)
            {
                this.Popup("损耗时间不能为空,请重新选择时间!");
                return;
            }
            if (this.txtLostCount.Text.Trim() == "")
            {
                this.Popup("损耗数量不能为空!");
                return;
            }
            if (this.txtMdate.Text.Trim() == "" || this.txtExpDate.Text.Trim() == "")
            {
                this.Popup("生产日期和过期日期不能为空!");
                return;
            }
            Entity.LostSerial ls = new LostSerial();
            ls.cnvcInvCode     = this.txtInvCode.Text.Trim();
            ls.cnnLostCount    = Math.Round(decimal.Parse(this.txtLostCount.Text.Trim()), 2);
            ls.cnnAddCount     = 0;
            ls.cnnReduceCount  = 0;
            ls.cndLostDate     = DateTime.Parse(strLostDate);
            ls.cnvcDeptID      = this.ddlDeptID.SelectedValue;
            ls.cnvcWhCode      = this.ddlWhouse.SelectedValue;
            ls.cnvcOperID      = this.oper.strLoginID;
            ls.cnvcLostType    = "1";
            ls.cnvcComments    = this.txtComments.Text.Trim();
            ls.cnvcInvalidFlag = "0";
            ls.cnvcComunitCode = this.txtUnitCode.Text.Trim();
            ls.cndMdate        = DateTime.Parse(this.txtMdate.Text.Trim());
            ls.cndExpDate      = DateTime.Parse(this.txtExpDate.Text.Trim());

            if (ls.cnvcDeptID == "" || ls.cnvcWhCode == "")
            {
                this.Popup("部门和仓库不能为空!");
                return;
            }
            if (ls.cnvcInvCode == "")
            {
                this.Popup("报损存货不能为空!");
                return;
            }
            if (ls.cndExpDate.CompareTo(DateTime.Now) > 0)
            {
                this.Popup("此存货尚未过期,不能报废!");
                return;
            }
            string strsql = "select cast(cnnQuantity/(select cniChangRate from tbComputationUnit where cnvcComunitCode='" + ls.cnvcComunitCode + "') as numeric(10,4)) as cnnQuantity from tbCurrentStock";

            strsql += " where cnvcWhCode='" + ls.cnvcWhCode + "' and cnvcInvCode='" + ls.cnvcInvCode + "' and convert(char(10),cndMdate,121)='" + ls.cndMdate.ToString("yyyy-MM-dd") + "' and convert(char(10),cndExpDate,121)='" + ls.cndExpDate.ToString("yyyy-MM-dd") + "'";
            string strQuantity = Helper.Query(strsql).Rows[0]["cnnQuantity"].ToString();

            if (ls.cnnLostCount > Math.Round(decimal.Parse(strQuantity), 2))
            {
                this.Popup("损耗数量不能大于库存数量!");
                return;
            }

            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            ol.cnvcOperType = "添加过期损耗";
            ol.cnvcOperID   = this.oper.strLoginID;
            ol.cnvcDeptID   = this.oper.strDeptID;

            StorageFacade sto = new StorageFacade();
            int           ret = sto.AddLostSerial(ol, ls);

            if (ret > 0)
            {
                this.Popup("添加过期损耗成功!");
            }
            else
            {
                this.Popup("添加过期损耗失败!");
            }
        }
        private void Datagrid2_UpdateCommand(object source, DataGridCommandEventArgs e)
        {
            string checkcount = ((TextBox)e.Item.Cells[8].Controls[0]).Text.Trim();
            string strmdate   = "";
            string strexpdate = "";
            string strflag    = "";

            if (e.Item.Cells[9].Text.Trim() == "" || e.Item.Cells[9].Text.Trim() == "&nbsp;")
            {
                strmdate   = ((System.Web.UI.HtmlControls.HtmlInputText)e.Item.Cells[10].Controls[1]).Value;
                strexpdate = ((System.Web.UI.HtmlControls.HtmlInputText)e.Item.Cells[12].Controls[1]).Value;
            }
            else
            {
                strmdate   = e.Item.Cells[9].Text.Trim();
                strexpdate = e.Item.Cells[11].Text.Trim();
            }

            string checkno = e.Item.Cells[0].Text.Trim();

            if (checkcount == "" || !this.JudgeIsNum(checkcount))
            {
                this.Popup("盘点存量不能为空且必须是数字!");
                this.hidecontrol();
                return;
            }
            if (strmdate == "")
            {
                this.Popup("生产日期不能为空!");
                this.hidecontrol();
                return;
            }
            if (strexpdate == "")
            {
                this.Popup("过期日期不能为空!");
                this.hidecontrol();
                return;
            }
            StorageCheckLog scl = new StorageCheckLog();

            scl.cnnSerialNo   = decimal.Parse(e.Item.Cells[1].Text.Trim());
            scl.cnnCheckCount = Math.Round(decimal.Parse(checkcount), 2);
            scl.cnvcOperName  = this.oper.strOperName;
            if (e.Item.Cells[9].Text.Trim() == "" || e.Item.Cells[9].Text.Trim() == "&nbsp;")
            {
                scl.cndMdate   = DateTime.Parse(strmdate);
                scl.cndExpDate = DateTime.Parse(strexpdate);
                strflag        = "up_date";
                if (scl.cndMdate.CompareTo(scl.cndExpDate) > 0)
                {
                    this.Popup("生产日期不能大于过期日期!");
                    this.hidecontrol();
                    return;
                }
            }
            StorageFacade sto = new StorageFacade();
            int           ret = sto.UpdateStorageCheckLog(scl, strflag);

            if (ret > 0)
            {
                this.Popup("修改盘点存货库存量成功!");
            }
            else
            {
                this.Popup("修改盘点存货库存量失败!");
            }

            this.DBBind();
            this.ddlDept.Enabled       = false;
            this.ddlWhouse.Enabled     = false;
            this.ddlDayCheckNo.Enabled = false;
            this.btnCheckOk.Enabled    = true;
        }
Example #30
0
        private void btAdd_Click(object sender, System.EventArgs e)
        {
            strOutArriveDate = Request.Form["txtOutArvDate"].ToString();
            if (strOutArriveDate == "" || strOutArriveDate == null)
            {
                this.Popup("出库时间不能为空,请重新选择时间!");
                return;
            }
            strInArriveDate = Request.Form["txtInArvDate"].ToString();
            if (strInArriveDate == "" || strInArriveDate == null)
            {
                this.Popup("入库时间不能为空,请重新选择时间!");
                return;
            }
            Entity.RdRecord rdout = new RdRecord();
            rdout.cnvcCode         = this.txtMoveCode.Text.Trim();
            rdout.cnvcRdCode       = "RD005";
            rdout.cnvcRdFlag       = "1";
            rdout.cnvcWhCode       = this.ddlOutWhouse.SelectedValue;
            rdout.cnvcDepID        = this.ddlOutDeptID.SelectedValue;
            rdout.cnvcWhpersonName = this.txtOutWHPerson.Text.Trim();
            rdout.cnvcOperName     = this.oper.strOperName;
            rdout.cnvcComments     = this.txtComments.Text.Trim();
            rdout.cnvcMaker        = this.oper.strOperName;
            rdout.cnvcShipAddress  = this.txtShipAddress.Text.Trim();
            rdout.cndARVDate       = DateTime.Parse(strOutArriveDate);
            rdout.cnvcARVAddress   = this.txtArvAddress.Text.Trim();
            rdout.cnvcState        = "0";

            Entity.RdRecord rdin = new RdRecord();
            rdin.cnvcCode         = this.txtMoveCode.Text.Trim();
            rdin.cnvcRdCode       = "RD006";
            rdin.cnvcRdFlag       = "0";
            rdin.cnvcWhCode       = this.ddlInWhouse.SelectedValue;
            rdin.cnvcDepID        = this.ddlInDeptID.SelectedValue;
            rdin.cnvcWhpersonName = this.txtInWHPerson.Text.Trim();
            rdin.cnvcOperName     = this.oper.strOperName;
            rdin.cnvcComments     = this.txtComments.Text.Trim();
            rdin.cnvcMaker        = this.oper.strOperName;
            rdin.cnvcShipAddress  = this.txtShipAddress.Text.Trim();
            rdin.cndARVDate       = DateTime.Parse(strInArriveDate);
            rdin.cnvcARVAddress   = this.txtArvAddress.Text.Trim();
            rdin.cnvcState        = "0";

            if (rdout.cnvcCode == "" || rdout.cnvcCode.Length != 13 || rdin.cnvcCode == "" || rdin.cnvcCode.Length != 13)
            {
                this.Popup("调拨单号不正确!");
                return;
            }
            if (rdout.cnvcDepID == "" || rdout.cnvcWhCode == "")
            {
                this.Popup("出库部门或仓库不能为空!");
                return;
            }
            if (rdin.cnvcDepID == "" || rdin.cnvcWhCode == "")
            {
                this.Popup("出库部门或仓库不能为空!");
                return;
            }
            if (rdout.cnvcWhCode == rdin.cnvcWhCode)
            {
                this.Popup("同一仓库不能调拨!");
                return;
            }

            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            ol.cnvcOperType = "添加调拨主单";
            ol.cnvcOperID   = this.oper.strLoginID;
            ol.cnvcDeptID   = this.oper.strDeptID;

            StorageFacade sto = new StorageFacade();
            int           ret = sto.AddRdRecordMove(ol, rdout, rdin);

            if (ret > 0)
            {
                this.Popup("添加调拨单内容成功!");
            }
            else
            {
                this.Popup("添加调拨单内容失败!");
            }
        }