示例#1
0
 public IList<PltstandardInfo> GetPLTStandardList()
 {
    IList<PltstandardInfo> PltstandardList = new List<PltstandardInfo>();
     try 
     {
         PltstandardInfo cond = new PltstandardInfo();
         PltstandardList = PalletRepository.GetPltstandardInfoList(cond);
     }
     catch(FisException fe)
     {
         logger.Error(fe.Message);
         throw fe;
     }
     catch(Exception e)
     {
         logger.Error(e.Message);
         throw e;
     }
     return PltstandardList;
 }
示例#2
0
        public string AddPLTStandard(PltstandardInfo PLTStdItem)
        {
            string id = null;
            IList<PltstandardInfo> PltstandardList = new List<PltstandardInfo>();
            try 
            {
                if (PLTStdItem == null)
                {
                    //throw exception;
                }
                else
                {
                    //Vincent:don't use SqlTransactionManage
                    //SqlTransactionManager.Begin();
                    //若txtPallet 框中的内容在Delivery_Pallet (Delivery_Pallet.PalletNo)中不存在,
                    //则提示用户,放弃后续操作
                    //IDeliveryRepository IList<DeliveryPalletInfo> GetDeliveryPalletListByPlt(string palletNo);
                    IDeliveryRepository DeliveryRepository = RepositoryFactory.GetInstance().GetRepository<IDeliveryRepository, Delivery>();
                    IList<DeliveryPalletInfo> DNInfoList = new List<DeliveryPalletInfo>();
                    DNInfoList = DeliveryRepository.GetDeliveryPalletListByPlt(PLTStdItem.pltno);
                    if ((DNInfoList == null) || (DNInfoList.Count == 0))
                    {
                        FisException ex;
                        List<string> erpara = new List<string>();
                        erpara.Add(PLTStdItem.pltno);
                        ex = new FisException("CHK241", erpara);
                        throw ex;
                    }
                    PltstandardInfo cond = new PltstandardInfo();
                    cond.pltno = PLTStdItem.pltno;
                    PltstandardList = PalletRepository.GetPltstandardInfoList(cond);
                    if (PltstandardList.Count > 0)
                    {
                        List<string> erpara = new List<string>();
                        FisException ex;
                        ex = new FisException("DMT155", erpara);
                        throw ex;
                    }
                    //PltstandardInfo newitem = new PltstandardInfo();
                    PLTStdItem.cdt = DateTime.Now;
                    PLTStdItem.udt = DateTime.Now;
                    
                     UnitOfWork uow = new UnitOfWork();
                    //PalletRepository.AddPltstandardInfo(PLTStdItem);
                     PalletRepository.AddPltstandardInfoDefered(uow, PLTStdItem);
                    //PalletRepository.UpdateAttr(PLTStdItem.pltno, "SendStatus", "", "Set to resend to SAP", PLTStdItem.editor);
                     PalletRepository.UpdateAttrDefered(uow, PLTStdItem.pltno, "SendStatus", "", "Set to resend to SAP", PLTStdItem.editor);
                     uow.Commit();
                    //SqlTransactionManager.Commit();

                    return Convert.ToString(PLTStdItem.id);



                }


            }
            catch(Exception e)
            {
                logger.Error(e.Message);
                throw e;
            }
            return id;
        }
示例#3
0
 public void DeletePLTStandard(int id)
 {
     try 
     {
         PltstandardInfo conItem = new PltstandardInfo();
         conItem.id = id;
         PalletRepository.DeletePltstandardInfo(conItem);
     }
     catch(Exception e)
     {
         logger.Error(e.Message);
         throw e;
     }
 }
示例#4
0
        public void UpdatePLTStandard(PltstandardInfo PLTStdItem)
        {
            try 
            {
                //若txtPallet 框中的内容在Delivery_Pallet (Delivery_Pallet.PalletNo)中不存在,
                //则提示用户,放弃后续操作
                //IDeliveryRepository IList<DeliveryPalletInfo> GetDeliveryPalletListByPlt(string palletNo);
                IDeliveryRepository DeliveryRepository = RepositoryFactory.GetInstance().GetRepository<IDeliveryRepository, Delivery>();
                IList<DeliveryPalletInfo> DNInfoList = new List<DeliveryPalletInfo>();
                DNInfoList = DeliveryRepository.GetDeliveryPalletListByPlt(PLTStdItem.pltno);
                if ((DNInfoList == null) || (DNInfoList.Count == 0))
                {
                    FisException ex;
                    List<string> erpara = new List<string>();
                    erpara.Add(PLTStdItem.pltno);
                    ex = new FisException("CHK241", erpara);
                    throw ex;
                }
                
                IList<PltstandardInfo> PltstandardList = new List<PltstandardInfo>();
                PltstandardInfo cond = new PltstandardInfo();
                cond.pltno = PLTStdItem.pltno;
                bool repeatFlag = false;
                PltstandardList = PalletRepository.GetPltstandardInfoList(cond);
                foreach (var node in PltstandardList)
                {
                    if (node.id != PLTStdItem.id)
                    {
                        repeatFlag = true;
                        break;
                    }
                }
                if (repeatFlag)
                {
                    List<string> erpara = new List<string>();
                    FisException ex;
                    ex = new FisException("DMT155", erpara);
                    throw ex;
                }

                PltstandardInfo conItem = new PltstandardInfo();
                conItem.id = PLTStdItem.id;

                PLTStdItem.id = int.MinValue;
                PLTStdItem.udt = DateTime.Now;
                PalletRepository.UpdatePltstandardInfo(PLTStdItem, conItem);    
            }
            catch(Exception e)
            {
                logger.Error(e.Message);
                throw e;
            }
        }
示例#5
0
    protected void btnSave_ServerClick(object sender, EventArgs e)
    {

        string itemId = this.HiddenSelectedId.Value.Trim();

        PltstandardInfo PltStd = new PltstandardInfo();
        PltStd.pltno = this.TextPalletNO.Text.Trim();
        //PltStd.len = decimal.Parse(this.TextLength.Text);
        //PltStd.wide = decimal.Parse(this.TextWidth.Text);
        //PltStd.high = decimal.Parse(this.TextHeight.Text);
        PltStd.len = decimal.Parse(this.HiddenLenght.Value);
        PltStd.wide = decimal.Parse(this.HiddenWidth.Value);
        PltStd.high = decimal.Parse(this.HiddenHeight.Value);
        //PltStd.cause = this.ddlCause.InnerDropDownList.SelectedValue;
        PltStd.editor = this.HiddenUserName.Value.Trim();

        PltStd.id = Convert.ToInt32(itemId);
        
        try
        {
            iPLTStandard.UpdatePLTStandard(PltStd);
        }
        catch(FisException fe)
        {
            showErrorMessage(fe.mErrmsg);
            return;
        }
        catch(Exception ee)
        {
            showErrorMessage(ee.Message);
            return;
        }
        showPLTStdList();
        this.updatePanel2.Update();
        ScriptManager.RegisterStartupScript(this.updatePanel2, typeof(System.Object), "saveUpdate", "AddUpdateComplete('" + itemId + "');HideWait();", true);

    }