Exemplo n.º 1
0
 public Appointment(string appointmentType, DateWithTime requestedDateWithTime, Id clientId, Id patientId)
 {
     Id = Guid.NewGuid();
     CreatedDateTime   = DateTime.Now;
     AppointmentType   = appointmentType;
     RequestedDateTime = requestedDateWithTime;
     ClientId          = clientId;
     PatientId         = patientId;
 }
        //protected override void gridWebGrid_ItemCommand(GridRecord row, string commandName)
        //{
        //    if (commandName == "Edit")
        //    {
        //        object obj = this.GetEditObject(row);
        //        if (obj != null)
        //        {
        //            this.SetEditObject(obj);
        //            this.buttonHelper.PageActionStatusHandle(PageActionType.Update);
        //        }
        //    }
        //    else if (commandName == "LinkDetail")
        //    {
        //        string pickNo = row.Items.FindItemByKey("PickNo").Text.Trim();
        //        //string storageOut = row.Items.FindItemByKey("StorageOut").Text.Trim();
        //        Response.Redirect(this.MakeRedirectUrl("FCreatePickLineMP.aspx", new string[] { "ACT", "PickNo" }, new string[] { "LinkDetail", pickNo }));
        //    }
        //}



        protected override void cmdExport_Click(object sender, EventArgs e)
        {
            BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);

            List <string> ca = new List <string>();

            XlsPackage xls  = new XlsPackage();
            IFont      font = xls.Black;

            font.FontHeightInPoints = 10;
            ICellStyle style = xls.Normal;

            style.SetFont(font);


            xls.CreateSheet("出库明细表");
            xls.NewRow(0);



            xls.Cell(0, "拣货任务令号", style);
            xls.Cell(1, "SAP单据号", style);
            xls.Cell(2, "出库类型", style);
            xls.Cell(3, "库位", style);
            xls.Cell(4, "创建时间", style);
            xls.Cell(5, "出库执行周期", style);
            xls.Cell(6, "库房操作周期", style);
            xls.Cell(7, "下发时间", style);
            xls.Cell(8, "下发执行周期", style);
            xls.Cell(9, "拣料开始时间", style);
            xls.Cell(10, "拣料完成时间", style);
            xls.Cell(11, "拣料执行周期", style);
            xls.Cell(12, "包装开始时间", style);
            xls.Cell(13, "包装完成时间", style);
            xls.Cell(14, "包装执行周期", style);
            xls.Cell(15, "OQC开始时间", style);
            xls.Cell(16, "OQC完成时间", style);
            xls.Cell(17, "OQC执行周期", style);
            xls.Cell(18, "箱单开始时间", style);
            xls.Cell(19, "箱单完成时间", style);
            xls.Cell(20, "制作箱单周期", style);
            xls.Cell(21, "发货时间", style);
            xls.Cell(22, "发货执行周期", style);
            xls.Cell(23, "箱数", style);
            xls.Cell(24, "重量", style);
            xls.Cell(25, "体积", style);
            xls.Cell(26, "Orderline行数", style);

            OutStorageDetail[] details = _WarehouseFacade.QueryOutStorageDetails(this.txtStorageCodeQuery.Text,
                                                                                 this.drpPickTypeQuery.SelectedValue,
                                                                                 FormatHelper.TODateInt(dateInDateFromQuery.Text),
                                                                                 FormatHelper.TODateInt(dateInDateToQuery.Text));

            int rowNum = 1;

            for (int i = 0; i < details.Length; i++)
            {
                xls.NewRow(rowNum);
                string PICKNO = details[i].PICKNO;
                xls.Cell(0, PICKNO, style);
                string INVNO = details[i].INVNO;
                xls.Cell(1, INVNO, style);
                string PICKTYPE = details[i].PICKTYPE;
                xls.Cell(2, PICKTYPE, style);
                string StorageCode = details[i].STORAGECODE;
                xls.Cell(3, StorageCode, style);
                string CDATE = FormatHelper.TODateTimeString(details[i].CDATE, details[i].CTIME);
                xls.Cell(4, CDATE, style);

                decimal periodOutDec     = _WarehouseFacade.Totalday(details[i].Delivery_Date, details[i].Delivery_Time, details[i].CDATE, details[i].CTIME);
                string  OUTSTORAGEPERIOD = string.Empty;
                if (periodOutDec >= 0)
                {
                    OUTSTORAGEPERIOD = periodOutDec.ToString();
                }
                xls.Cell(5, OUTSTORAGEPERIOD, style);


                DateWithTime pickBeginTime = _WarehouseFacade.StrToDateWithTime(details[i].MINPICK, '-');
                decimal      warePeriod    = _WarehouseFacade.Totalday(details[i].Delivery_Date, details[i].Delivery_Time, pickBeginTime.Date, pickBeginTime.Time);
                string       WAREPERIOD    = string.Empty;
                if (warePeriod >= 0)
                {
                    WAREPERIOD = warePeriod.ToString();
                }
                xls.Cell(6, WAREPERIOD, style);



                string DOWNDATE = FormatHelper.TODateTimeString(details[i].Down_Date, details[i].Down_Time);
                xls.Cell(7, DOWNDATE, style);

                string  downPeriod    = string.Empty;
                decimal downPeriodDec = _WarehouseFacade.Totalday(details[i].Down_Date, details[i].Down_Time, details[i].CDATE, details[i].CTIME);
                if (downPeriodDec >= 0)
                {
                    downPeriod = downPeriodDec.ToString();
                }
                xls.Cell(8, downPeriod, style);


                string PICKBEGINTIME = FormatHelper.TODateTimeString(pickBeginTime.Date, pickBeginTime.Time);
                xls.Cell(9, PICKBEGINTIME, style);


                DateWithTime pickEndTime = _WarehouseFacade.StrToDateWithTime(details[i].MAXPICK, '-');
                string       PICKENDTIME = FormatHelper.TODateTimeString(pickEndTime.Date, pickEndTime.Time);
                xls.Cell(10, PICKENDTIME, style);

                decimal pickPeriod    = _WarehouseFacade.Totalday(pickEndTime.Date, pickEndTime.Time, pickBeginTime.Date, pickBeginTime.Time);
                string  pickPeriodStr = string.Empty;
                if (pickPeriod >= 0)
                {
                    pickPeriodStr = pickPeriod.ToString();
                }
                xls.Cell(11, pickPeriodStr, style);


                //DateWithTime packBeginTime = _WarehouseFacade.StrToDateWithTime(details[i].MINPACK, '-');

                DateWithTime packBeginTime = pickEndTime;
                DateWithTime packEndTime   = _WarehouseFacade.StrToDateWithTime(details[i].MAXPACK, '-');
                string       PACKBEGINTIME = FormatHelper.TODateTimeString(packBeginTime.Date, packBeginTime.Time);
                xls.Cell(12, PACKBEGINTIME, style);
                string PACKENDTIME = FormatHelper.TODateTimeString(packEndTime.Date, packEndTime.Time);
                xls.Cell(13, PACKENDTIME, style);



                decimal packPeriod    = _WarehouseFacade.Totalday(packEndTime.Date, packEndTime.Time, packBeginTime.Date, packBeginTime.Time);
                string  packPeriodStr = string.Empty;
                if (packPeriod >= 0)
                {
                    packPeriodStr = packPeriod.ToString();
                }
                xls.Cell(14, packPeriodStr, style);


                //DateWithTime oqcBeginTime = _WarehouseFacade.StrToDateWithTime(details[i].OQCCDATE, '-');

                DateWithTime oqcBeginTime = packEndTime;
                string       OQCBEGINTIME = FormatHelper.TODateTimeString(oqcBeginTime.Date, oqcBeginTime.Time);
                xls.Cell(15, OQCBEGINTIME, style);


                DateWithTime oqcEndTime = _WarehouseFacade.StrToDateWithTime(details[i].OQCDATE, '-');
                string       OQCENDTIME = FormatHelper.TODateTimeString(oqcEndTime.Date, oqcEndTime.Time);
                xls.Cell(16, OQCENDTIME, style);


                decimal oqcPeriod    = _WarehouseFacade.Totalday(oqcEndTime.Date, oqcEndTime.Time, oqcBeginTime.Date, oqcBeginTime.Time);
                string  oqcPeriodStr = string.Empty;
                if (oqcPeriod >= 0)
                {
                    oqcPeriodStr = oqcPeriod.ToString();
                }
                xls.Cell(17, oqcPeriodStr, style);


                //DateWithTime cartonnoBeginTime = _WarehouseFacade.StrToDateWithTime(details[i].CDATETIME, '-');

                DateWithTime cartonnoBeginTime = oqcEndTime;
                string       CARINVNOBEGINTIME = FormatHelper.TODateTimeString(cartonnoBeginTime.Date, cartonnoBeginTime.Time);
                xls.Cell(18, CARINVNOBEGINTIME, style);


                string CARINVNOENDTIME = FormatHelper.TODateTimeString(details[i].Packing_List_Date, details[i].Packing_List_Time);
                xls.Cell(19, CARINVNOENDTIME, style);


                decimal carinvnoPeriod    = _WarehouseFacade.Totalday(details[i].Packing_List_Date, details[i].Packing_List_Time, cartonnoBeginTime.Date, cartonnoBeginTime.Time);
                string  carinvnoPeriodStr = string.Empty;
                if (carinvnoPeriod >= 0)
                {
                    carinvnoPeriodStr = carinvnoPeriod.ToString();
                }
                xls.Cell(20, carinvnoPeriodStr, style);



                string OUTSTORAGETIME = FormatHelper.TODateTimeString(details[i].Delivery_Date, details[i].Delivery_Time);
                xls.Cell(21, OUTSTORAGETIME, style);



                decimal outStoragePeriod1    = _WarehouseFacade.Totalday(details[i].Delivery_Date, details[i].Delivery_Time, details[i].Packing_List_Date, details[i].Packing_List_Time);
                string  outStoragePeriod1Str = string.Empty;
                if (outStoragePeriod1 >= 0)
                {
                    outStoragePeriod1Str = outStoragePeriod1.ToString();
                }
                xls.Cell(22, outStoragePeriod1Str, style);


                string CARTONNOS = details[i].CARTONNOS.ToString();
                xls.Cell(23, CARTONNOS, style);



                string WEIGHT = details[i].GROSS_WEIGHT.ToString();
                xls.Cell(24, WEIGHT, style);

                string VOLUME = details[i].VOLUMN.ToString();
                xls.Cell(25, VOLUME, style);

                string ORDERLINES = _WarehouseFacade.QueryOrderLines(details[i].PICKNO).ToString();
                xls.Cell(26, ORDERLINES, style);

                rowNum++;
            }



            string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls");
            string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename);



            FileStream file = new FileStream(filepath, FileMode.Create, FileAccess.ReadWrite);

            xls.Save(file);
            file.Close();

            DownLoadFile1(filename);
        }
        protected override DataRow GetGridRow(object obj)
        {
            DataRow          row = this.DtSource.NewRow();
            OutStorageDetail s   = (OutStorageDetail)obj;

            WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);

            row["PICKNO"]         = s.PICKNO;
            row["INVNO"]          = s.INVNO;
            row["PICKTYPE"]       = GetPickTypeName(s.PICKTYPE);
            row["StorageCode123"] = s.STORAGECODE;
            row["CDATE"]          = FormatHelper.TODateTimeString(s.CDATE, s.CTIME);


            decimal periodOutDec     = _WarehouseFacade.Totalday(s.Delivery_Date, s.Delivery_Time, s.CDATE, s.CTIME);
            string  outStoragePeriod = string.Empty;

            if (periodOutDec >= 0)
            {
                outStoragePeriod = periodOutDec.ToString();
            }
            row["OUTSTORAGEPERIOD"] = outStoragePeriod;

            DateWithTime pickBeginTime = _WarehouseFacade.StrToDateWithTime(s.MINPICK, '-');
            decimal      warePeriod    = _WarehouseFacade.Totalday(s.Delivery_Date, s.Delivery_Time, pickBeginTime.Date, pickBeginTime.Time);
            string       warePeriodStr = string.Empty;

            if (warePeriod >= 0)
            {
                warePeriodStr = warePeriod.ToString();
            }
            row["WAREPERIOD"] = warePeriodStr;


            row["DOWNDATE"] = FormatHelper.TODateTimeString(s.Down_Date, s.Down_Time);

            string  downPeriod    = string.Empty;
            decimal downPeriodDec = _WarehouseFacade.Totalday(s.Down_Date, s.Down_Time, s.CDATE, s.CTIME);

            if (downPeriodDec >= 0)
            {
                downPeriod = downPeriodDec.ToString();
            }
            row["DOWNPERIOD"] = downPeriod;


            row["PICKBEGINTIME"] = FormatHelper.TODateTimeString(pickBeginTime.Date, pickBeginTime.Time);


            DateWithTime pickEndTime = _WarehouseFacade.StrToDateWithTime(s.MAXPICK, '-');

            row["PICKENDTIME"] = FormatHelper.TODateTimeString(pickEndTime.Date, pickEndTime.Time);


            decimal pickPeriod    = _WarehouseFacade.Totalday(pickEndTime.Date, pickEndTime.Time, pickBeginTime.Date, pickBeginTime.Time);
            string  pickPeriodStr = string.Empty;

            if (pickPeriod >= 0)
            {
                pickPeriodStr = pickPeriod.ToString();
            }
            row["PICKPERIOD"] = pickPeriodStr;



            //DateWithTime packBeginTime = _WarehouseFacade.StrToDateWithTime(s.MINPACK, '-');

            DateWithTime packBeginTime = pickEndTime;
            DateWithTime packEndTime   = _WarehouseFacade.StrToDateWithTime(s.MAXPACK, '-');

            row["PACKBEGINTIME"] = FormatHelper.TODateTimeString(packBeginTime.Date, packBeginTime.Time);
            row["PACKENDTIME"]   = FormatHelper.TODateTimeString(packEndTime.Date, packEndTime.Time);


            decimal packPeriod    = _WarehouseFacade.Totalday(packEndTime.Date, packEndTime.Time, packBeginTime.Date, packBeginTime.Time);
            string  packPeriodStr = string.Empty;

            if (packPeriod >= 0)
            {
                packPeriodStr = packPeriod.ToString();
            }
            row["PACKPERIOD"] = packPeriodStr;



            //DateWithTime oqcBeginTime = _WarehouseFacade.StrToDateWithTime(s.OQCCDATE, '-');
            DateWithTime oqcBeginTime = packEndTime;

            row["OQCBEGINTIME"] = FormatHelper.TODateTimeString(oqcBeginTime.Date, oqcBeginTime.Time);

            DateWithTime oqcEndTime = _WarehouseFacade.StrToDateWithTime(s.OQCDATE, '-');

            row["OQCENDTIME"] = FormatHelper.TODateTimeString(oqcEndTime.Date, oqcEndTime.Time);


            decimal oqcPeriod    = _WarehouseFacade.Totalday(oqcEndTime.Date, oqcEndTime.Time, oqcBeginTime.Date, oqcBeginTime.Time);
            string  oqcPeriodStr = string.Empty;

            if (oqcPeriod >= 0)
            {
                oqcPeriodStr = oqcPeriod.ToString();
            }
            row["OQCPERIOD"] = oqcPeriodStr;



            //DateWithTime cartonnoBeginTime = _WarehouseFacade.StrToDateWithTime(s.CDATETIME, '-');

            DateWithTime cartonnoBeginTime = oqcEndTime;

            row["CARINVNOBEGINTIME"] = FormatHelper.TODateTimeString(cartonnoBeginTime.Date, cartonnoBeginTime.Time);


            row["CARINVNOENDTIME"] = FormatHelper.TODateTimeString(s.Packing_List_Date, s.Packing_List_Time);



            decimal carinvnoPeriod    = _WarehouseFacade.Totalday(s.Packing_List_Date, s.Packing_List_Time, cartonnoBeginTime.Date, cartonnoBeginTime.Time);
            string  carinvnoPeriodStr = string.Empty;

            if (carinvnoPeriod >= 0)
            {
                carinvnoPeriodStr = carinvnoPeriod.ToString();
            }
            row["CARINVNOPERIOD"] = carinvnoPeriodStr;



            row["OUTSTORAGETIME"] = FormatHelper.TODateTimeString(s.Delivery_Date, s.Delivery_Time);


            decimal outStoragePeriod1    = _WarehouseFacade.Totalday(s.Delivery_Date, s.Delivery_Time, s.Packing_List_Date, s.Packing_List_Time);
            string  outStoragePeriod1Str = string.Empty;

            if (outStoragePeriod1 >= 0)
            {
                outStoragePeriod1Str = outStoragePeriod1.ToString();
            }
            row["OUTSTORAGEPERIOD1"] = outStoragePeriod1Str;



            row["CARTONNOS"] = s.CARTONNOS;

            row["WEIGHT"]     = s.GROSS_WEIGHT;
            row["VOLUME"]     = s.VOLUMN;
            row["ORDERLINES"] = _WarehouseFacade.QueryOrderLines(s.PICKNO);


            return(row);
        }
Exemplo n.º 4
0
        public static Appointment Load(Id appointmentId, Id clientId, Id patientId, string appointmentType, DateWithTime requestedDateTime, DateTime createdDateTime)
        {
            Appointment appointment = new Appointment()
            {
                Id                = appointmentId,
                ClientId          = clientId,
                PatientId         = patientId,
                AppointmentType   = appointmentType,
                RequestedDateTime = requestedDateTime,
                CreatedDateTime   = createdDateTime

                                    //Set variables here
            };

            return(appointment);
        }