Beispiel #1
0
        /// <summary>
        /// 物料查询 返回查询总数量与单页数据
        /// </summary>
        /// <param name="count"></param>
        /// <returns></returns>
        private List <AscmMaterialItem> materialQuery(ref int count)
        {
            List <AscmMaterialItem> listMaterials = null;
            string message = string.Empty;
            string _ynPage = string.Empty;

            string queryMaterialDocNumber = txtMaterialDocNumber.Text;

            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(pageControlMaterial.PageSize);
            ynPage.SetCurrentPage((pageControlMaterial.PageCurrent <= 0) ? 1 : pageControlMaterial.PageCurrent);
            _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage);

            WinForm.AscmWebService.AscmWebService service = new AscmWebService.AscmWebService();
            string jsonstr = service.GetMaterialList(frmMain.encryptTicket, queryMaterialDocNumber, ref _ynPage, ref message);

            if (!string.IsNullOrEmpty(jsonstr))
            {
                listMaterials = (List <AscmMaterialItem>)JsonConvert.DeserializeObject(jsonstr, typeof(List <AscmMaterialItem>));
                if (listMaterials != null && listMaterials.Count > 0)
                {
                    ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage);
                    count  = ynPage.GetRecordCount();
                }
                else
                {
                    MessageBoxEx.Show("没有查询到符合条件的领料任务!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            return(listMaterials);
        }
Beispiel #2
0
        private List <AscmWipRequirementOperations> DataBindDataGridView(ref int count, string queryStartTime, string queryEndTime)
        {
            List <AscmWipRequirementOperations> list = null;
            string message = string.Empty;
            string _ynPage = string.Empty;

            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(pagerControlMaterial.PageSize);
            ynPage.SetCurrentPage((pagerControlMaterial.PageCurrent <= 0) ? 1 : pagerControlMaterial.PageCurrent);
            _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage);

            try
            {
                AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService();
                string jsonString = Service.SumMaterial(frmMainView.encryptTicket, frmMainView.userName, queryStartTime, queryEndTime, ref _ynPage, ref message);
                if (!string.IsNullOrEmpty(jsonString))
                {
                    list = (List <AscmWipRequirementOperations>)JsonConvert.DeserializeObject(jsonString, typeof(List <AscmWipRequirementOperations>));
                    if (list != null && list.Count > 0)
                    {
                        ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage);
                        count  = ynPage.GetRecordCount();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(list);
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                string queryWord = "";

                if (Request.QueryString["queryWord"] != null && Request.QueryString["queryWord"].Trim() != "" && Request.QueryString["queryWord"].Trim() != "null")
                    queryWord = Request.QueryString["queryWord"].Trim();

                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500); //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List<AscmSupplier> listAscmSupplier = AscmSupplierService.GetInstance().GetList(ynPage, "", "", queryWord, null);
                ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("SupplierReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name = "DataSet1";
                rds1.Value = listAscmSupplier;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                string companpyTitle = "美的中央空调";
                string title = companpyTitle + "供应商";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title", title),
                    new ReportParameter("ReportParameter_ReportTime", "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"))
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
Beispiel #4
0
        private List <AscmMaterialItem> GetMaterialItem(ref int count)
        {
            List <AscmMaterialItem> list = null;
            string message = string.Empty;
            string _ynPage = string.Empty;

            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(pcMaterialList.PageSize);
            ynPage.SetCurrentPage((pcMaterialList.PageCurrent <= 0) ? 1 : pcMaterialList.PageCurrent);
            _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage);
            try
            {
                WinForm.AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService();
                string jsonStr = Service.SumMaterialTotal(frmMain.encryptTicket, ref _ynPage, ref message);
                if (!string.IsNullOrEmpty(jsonStr))
                {
                    list = (List <AscmMaterialItem>)JsonConvert.DeserializeObject(jsonStr, typeof(List <AscmMaterialItem>));
                    if (list != null && list.Count > 0)
                    {
                        ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage);
                        count  = ynPage.GetRecordCount();
                    }
                    else
                    {
                        MessageBoxEx.Show("系统没查到当天的作业单的所有物料!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(list);
        }
Beispiel #5
0
        private List <AscmMtlOnhandQuantitiesDetail> DataBindDataGridView(ref int count, int queryId)
        {
            List <AscmMtlOnhandQuantitiesDetail> list = null;
            string message = string.Empty;
            string _ynPage = string.Empty;

            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(pagerControlMaterial.PageSize);
            ynPage.SetCurrentPage((pagerControlMaterial.PageCurrent <= 0) ? 1 : pagerControlMaterial.PageCurrent);
            _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage);

            try
            {
                AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService();
                string jsonString = Service.GetMaterialWarehouseList(frmMainView.encryptTicket, materialId, ref _ynPage, ref message);
                if (!string.IsNullOrEmpty(jsonString))
                {
                    list = (List <AscmMtlOnhandQuantitiesDetail>)JsonConvert.DeserializeObject(jsonString, typeof(List <AscmMtlOnhandQuantitiesDetail>));
                    if (list != null && list.Count > 0)
                    {
                        ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage);
                        count  = ynPage.GetRecordCount();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(list);
        }
Beispiel #6
0
        private List<AscmMaterialItem> GetMaterialItem(ref int count)
        {
            List<AscmMaterialItem> list = null;
            string message = string.Empty;
            string _ynPage = string.Empty;

            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(pcMaterialList.PageSize);
            ynPage.SetCurrentPage((pcMaterialList.PageCurrent <= 0) ? 1 : pcMaterialList.PageCurrent);
            _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage);
            try
            {

                WinForm.AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService();
                string jsonStr = Service.SumMaterialTotal(frmMain.encryptTicket, ref _ynPage, ref message);
                if (!string.IsNullOrEmpty(jsonStr))
                {
                    list = (List<AscmMaterialItem>)JsonConvert.DeserializeObject(jsonStr, typeof(List<AscmMaterialItem>));
                    if (list != null && list.Count > 0)
                    {
                        ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage);
                        count = ynPage.GetRecordCount();
                    }
                    else
                    {
                        MessageBoxEx.Show("系统没查到当天的作业单的所有物料!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return list;
        }
        private List<AscmWipRequirementOperations> DataBindDataGridView(ref int count, string queryStartTime, string queryEndTime)
        {
            List<AscmWipRequirementOperations> list = null;
            string message = string.Empty;
            string _ynPage = string.Empty;

            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(pagerControlMaterial.PageSize);
            ynPage.SetCurrentPage((pagerControlMaterial.PageCurrent <= 0) ? 1 : pagerControlMaterial.PageCurrent);
            _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage);

            try
            {
                AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService();
                string jsonString = Service.SumMaterial(frmMainView.encryptTicket, frmMainView.userName, queryStartTime, queryEndTime, ref _ynPage, ref message);
                if (!string.IsNullOrEmpty(jsonString))
                {
                    list = (List<AscmWipRequirementOperations>)JsonConvert.DeserializeObject(jsonString, typeof(List<AscmWipRequirementOperations>));
                    if (list != null && list.Count > 0)
                    {
                        ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage);
                        count = ynPage.GetRecordCount();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return list;
        }
Beispiel #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                string   queryWord = ""; string wipEntityName = ""; string whereOther = "", whereStartModifyTime = "", whereEndModifyTime = "", whereWipEntityId = "", whereBillType = "";
                DateTime dtStartPlanTime, dtEndPlanTime;


                if (Request.QueryString["docNumber"] != null && Request.QueryString["docNumber"].Trim() != "" && Request.QueryString["docNumber"].Trim() != "null")
                {
                    queryWord = Request.QueryString["docNumber"].Trim();
                }
                if (Request.QueryString["wipEntityName"] != null && Request.QueryString["wipEntityName"].Trim() != "" && Request.QueryString["wipEntityName"].Trim() != "null")
                {
                    wipEntityName    = Request.QueryString["wipEntityName"].Trim();
                    whereWipEntityId = " wipEntityId in(select wipEntityId from AscmWipEntities where name like %'" + wipEntityName + "%')";
                }
                if (!string.IsNullOrEmpty(Request.QueryString["queryStartModifyTime"]) && DateTime.TryParse(Request.QueryString["queryStartModifyTime"].Trim(), out dtStartPlanTime))
                {
                    whereStartModifyTime = "modifyTime>='" + dtStartPlanTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                }
                if (!string.IsNullOrEmpty(Request.QueryString["queryEndModifyTime"]) && DateTime.TryParse(Request.QueryString["queryEndModifyTime"].Trim(), out dtEndPlanTime))
                {
                    whereEndModifyTime = "modifyTime<'" + dtEndPlanTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                }

                whereBillType = "billType='WIPENTITY'";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereBillType);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereWipEntityId);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartModifyTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndModifyTime);

                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500);  //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List <AscmWmsMtlReturnMain> listAscmWmsMtlReturnMain = AscmWmsMtlReturnMainService.GetInstance().GetList(ynPage, "modifyTime", "asc", queryWord, whereOther);

                ReportViewer1.ProcessingMode         = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("WmsJobMtlReturnPrintReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name  = "DataSet1";
                rds1.Value = listAscmWmsMtlReturnMain;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                string companpyTitle = "美的中央空调";
                string title         = companpyTitle + "作业退料";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title", title),
                    new ReportParameter("ReportParameter_ReportTime", "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")),
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
        private List <AscmGetMaterialTask> DataBindDataGridView(ref int count, string queryStartTime, string queryEndTime, string queryTaskStatus)
        {
            List <AscmGetMaterialTask> list = null;
            string message = string.Empty;
            string _ynPage = string.Empty;

            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(pagerControlTask.PageSize);
            ynPage.SetCurrentPage((pagerControlTask.PageCurrent <= 0) ? 1 : pagerControlTask.PageCurrent);
            _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage);

            try
            {
                string queryStatus = string.Empty;
                if (queryTaskStatus != null)
                {
                    switch (queryTaskStatus.ToString())
                    {
                    case "已分配":
                        queryStatus = "NOTEXECUTE";
                        break;

                    case "执行中":
                        queryStatus = "EXECUTE";
                        break;

                    case "已完成":
                        queryStatus = "FINISH";
                        break;

                    case "已关闭":
                        queryStatus = "CLOSE";
                        break;

                    default:
                        queryStatus = "";
                        break;
                    }
                }

                AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService();
                string jsonString = Service.GetUnAutoTaskList(frmMainView.encryptTicket, queryStartTime, queryEndTime, queryStatus, ref _ynPage, ref message);
                if (!string.IsNullOrEmpty(jsonString))
                {
                    list = (List <AscmGetMaterialTask>)JsonConvert.DeserializeObject(jsonString, typeof(List <AscmGetMaterialTask>));
                    if (list != null && list.Count > 0)
                    {
                        ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage);
                        count  = ynPage.GetRecordCount();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(list);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                string   queryWord = "", supplierDoc = "";
                string   whereOther = "", whereStartModifyTime = "", whereEndModifyTime = "";
                DateTime dtStartPlanTime, dtEndPlanTime;

                if (Request.QueryString["queryWord"] != null && Request.QueryString["queryWord"].Trim() != "" && Request.QueryString["queryWord"].Trim() != "null")
                {
                    queryWord = Request.QueryString["queryWord"].Trim();
                }
                if (Request.QueryString["supplierDoc"] != null && Request.QueryString["supplierDoc"].Trim() != "" && Request.QueryString["supplierDoc"].Trim() != "null")
                {
                    supplierDoc = Request.QueryString["supplierDoc"].Trim();
                }
                if (!string.IsNullOrEmpty(Request.QueryString["queryStartModifyTime"]) && DateTime.TryParse(Request.QueryString["queryStartModifyTime"].Trim(), out dtStartPlanTime))
                {
                    whereStartModifyTime = "modifyTime>='" + dtStartPlanTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                }
                if (!string.IsNullOrEmpty(Request.QueryString["queryEndModifyTime"]) && DateTime.TryParse(Request.QueryString["queryEndModifyTime"].Trim(), out dtEndPlanTime))
                {
                    whereEndModifyTime = "modifyTime<'" + dtEndPlanTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                }

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartModifyTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndModifyTime);

                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500);  //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List <AscmWmsBackInvoiceMain> listAscmWmsBackInvoiceMain = AscmWmsBackInvoiceMainService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                if (!string.IsNullOrEmpty(supplierDoc))
                {
                    listAscmWmsBackInvoiceMain = listAscmWmsBackInvoiceMain.Where(item => item.ascmSupplier.docNumber == supplierDoc).OrderBy(item => item.modifyTime).ToList();
                }

                ReportViewer1.ProcessingMode         = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("WmsBackInvoiceReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name  = "DataSet1";
                rds1.Value = listAscmWmsBackInvoiceMain;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                string companpyTitle = "美的中央空调";
                string title         = companpyTitle + "供应商退货";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title", title),
                    new ReportParameter("ReportParameter_ReportTime", "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"))
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                string queryWord = "";
                string whereOther = "", whereSupplier = "", whereWarehouse = "";
                string whereStartCreateTime = "", whereEndCreateTime = "", whereStatus = "", whereEmployeeBuyer = "";
                whereStatus = "status = '" + MideaAscm.Dal.FromErp.Entities.AscmDeliveryOrderMain.StatusDefine.open + "'";

                if (Request.QueryString["queryWord"] != null && Request.QueryString["queryWord"].ToString().Trim() != "" && Request.QueryString["queryWord"].ToString().Trim() != "null")
                    queryWord = Request.QueryString["queryWord"].ToString();
                if (Request.QueryString["supplier"] != null && Request.QueryString["supplier"].ToString().Trim() != "" && Request.QueryString["supplier"].ToString().Trim() != "null")
                    whereSupplier = "supplierId = '" + Request.QueryString["supplier"].ToString() + "'";
                if (Request.QueryString["warehouse"] != null && Request.QueryString["warehouse"].ToString().Trim() != "" && Request.QueryString["warehouse"].ToString().Trim() != "null")
                    whereWarehouse = "warehouseId = '" + Request.QueryString["warehouse"].ToString() + "'";

                DateTime dtStartCreateTime, dtEndCreateTime;
                if (Request.QueryString["startCreateTime"] != null && Request.QueryString["startCreateTime"].ToString().Trim() != "" && Request.QueryString["startCreateTime"].ToString().Trim() != "null" && DateTime.TryParse(Request.QueryString["startCreateTime"].ToString().Trim(), out dtStartCreateTime))
                    whereStartCreateTime = "createTime>='" + dtStartCreateTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (Request.QueryString["endCreateTime"] != null && Request.QueryString["endCreateTime"].ToString().Trim() != "" && Request.QueryString["endCreateTime"].ToString().Trim() != "null" && DateTime.TryParse(Request.QueryString["endCreateTime"].ToString().Trim(), out dtEndCreateTime))
                    whereEndCreateTime = "createTime<'" + dtEndCreateTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";

                if (Request.QueryString["employeeBuyer"] != null && Request.QueryString["employeeBuyer"].ToString().Trim() != "" && Request.QueryString["employeeBuyer"].ToString().Trim() != "null")
                    whereEmployeeBuyer = "id in(select batchId from AscmDeliveryOrderMain where id in(select mainId from AscmDeliveryOrderDetail where materialId in(select id from AscmMaterialItem where buyerId=" + Request.QueryString["employeeBuyer"].ToString() + ")))";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereSupplier);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereWarehouse);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStatus);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEmployeeBuyer);

                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500); //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;
                List<AscmDeliveryOrderBatch> listAscmDeliveryOrderBatch = AscmDeliveryOrderBatchService.GetInstance().GetMonitorList(ynPage, "", "", queryWord, whereOther);
                ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("MaterialMonitorReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name = "DataSet1";
                rds1.Value = listAscmDeliveryOrderBatch;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                //string companpyTitle = YnParameterService.GetInstance().GetValue(MyParameter.companpyTitle);
                string companpyTitle = "美的中央空调";
                string title = companpyTitle + "物料送货状态实时监控统计报表";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title",title ),
                    new ReportParameter("ReportParameter_ReportTime","打印时间:"+DateTime.Now.ToString("yyyy-MM-dd") )
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                string queryWord = "";
                string whereOther = "", whereWarehouse = "";
                string whereStartCreateTime = "", whereEndCreateTime = "";

                if (Request.QueryString["queryWord"] != null && Request.QueryString["queryWord"].Trim() != "" && Request.QueryString["queryWord"].Trim() != "null")
                {
                    queryWord = Request.QueryString["queryWord"].Trim();
                }
                if (Request.QueryString["warehouseId"] != null && Request.QueryString["warehouseId"].Trim() != "" && Request.QueryString["warehouseId"].Trim() != "null")
                {
                    whereWarehouse = "unloadingPointId in(select id from AscmUnloadingPoint where warehouseId='" + Request.QueryString["warehouseId"] + "')";
                }
                DateTime dtStartCreateTime, dtEndCreateTime;
                if (!string.IsNullOrEmpty(Request.QueryString["queryStartTime"]) && DateTime.TryParse(Request.QueryString["queryStartTime"], out dtStartCreateTime))
                {
                    whereStartCreateTime = "createTime>='" + dtStartCreateTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                }
                if (!string.IsNullOrEmpty(Request.QueryString["queryEndTime"]) && DateTime.TryParse(Request.QueryString["queryEndTime"], out dtEndCreateTime))
                {
                    whereEndCreateTime = "createTime<'" + dtEndCreateTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";
                }

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereWarehouse);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndCreateTime);

                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500);  //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List <AscmUnloadingPointLog> listAscmUnloadingPointLog = AscmUnloadingPointLogService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);

                ReportViewer1.ProcessingMode         = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("UnloadingPointLogReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name  = "DataSet1";
                rds1.Value = listAscmUnloadingPointLog;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                string companpyTitle = "美的中央空调";
                string title         = companpyTitle + "卸货点出入日志";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title", title),
                    new ReportParameter("ReportParameter_ReportTime", "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd"))
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                int mainId = 0;

                string whereOther = "";

                if (Request.QueryString["mainId"] != null && Request.QueryString["mainId"].Trim() != "" && Request.QueryString["mainId"].Trim() != "null")
                {
                    mainId = Convert.ToInt32(Request.QueryString["mainId"].Trim());
                }



                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500);  //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List <AscmWmsBackInvoiceDetail> listAscmWmsBackInvoiceDetail = AscmWmsBackInvoiceDetailService.GetInstance().GetList(ynPage, "", "", mainId, "", whereOther);
                AscmWmsBackInvoiceMain          ascmWmsBackInvoiceMain       = AscmWmsBackInvoiceMainService.GetInstance().Get(mainId);
                if (ascmWmsBackInvoiceMain != null)
                {
                    ascmWmsBackInvoiceMain.ascmSupplier = AscmSupplierService.GetInstance().Get(ascmWmsBackInvoiceMain.supplierId);
                }


                ReportViewer1.ProcessingMode         = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("WmsBackInvoiceDetailReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name  = "DataSet1";
                rds1.Value = listAscmWmsBackInvoiceDetail;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                string companpyTitle = "美的中央空调";
                string title         = companpyTitle + "供应商退货明细";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title", title),
                    new ReportParameter("ReportParameter_ReportTime", "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd")),
                    new ReportParameter("ReportParameter_DocNumber", "单据号:" + ascmWmsBackInvoiceMain.docNumber),
                    new ReportParameter("ReportParameter_ManualDocNumber", "手工单号:" + ascmWmsBackInvoiceMain.manualDocNumber),
                    new ReportParameter("ReportParameter_ResponsiblePerson", "责任人:" + ascmWmsBackInvoiceMain.responsiblePerson),
                    new ReportParameter("ReportParameter_WarehouseId", "默认仓库:" + ascmWmsBackInvoiceMain.warehouseId),
                    new ReportParameter("ReportParameter_StatusCn", "状态:" + ascmWmsBackInvoiceMain.statusCn),
                    new ReportParameter("ReportParameter_ReasonName", "退货原因:" + ascmWmsBackInvoiceMain.reasonName),
                    new ReportParameter("ReportParameter_SupplierDocNumber", "供方编码:" + ascmWmsBackInvoiceMain.supplierDocNumber),
                    new ReportParameter("ReportParameter_SupplierName", "供方名称:" + ascmWmsBackInvoiceMain.supplierName),
                    new ReportParameter("ReportParameter_Memo", "备注:" + ascmWmsBackInvoiceMain.memo),
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                string whereOther = "",whereDocNumber = "", whereSupplier = "", whereDirection = "";
                string whereStartCreateTime = "", whereEndCreateTime = "";

                if (Request.QueryString["docNumber"] != null && Request.QueryString["docNumber"].ToString().Trim() != "" && Request.QueryString["docNumber"].ToString().Trim() != "null")
                    whereDocNumber =  Request.QueryString["docNumber"].ToString();
                if (Request.QueryString["supplierId"] != null && Request.QueryString["supplierId"].ToString().Trim() != "" && Request.QueryString["supplierId"].ToString().Trim() != "null")
                    whereSupplier = "supplierId = '" + Request.QueryString["supplierId"].ToString() + "'";
                if (Request.QueryString["direction"] != null && Request.QueryString["direction"].ToString().Trim() != "" && Request.QueryString["direction"].ToString().Trim() != "null")
                    whereDirection = "direction = '" + Request.QueryString["direction"].ToString() + "'";

                DateTime dtStartCreateTime, dtEndCreateTime;
                if (Request.QueryString["StartTime"] != null && Request.QueryString["StartTime"].ToString().Trim() != "" && Request.QueryString["StartTime"].ToString().Trim() != "null" && DateTime.TryParse(Request.QueryString["StartTime"].ToString().Trim(), out dtStartCreateTime))
                    whereStartCreateTime = "createTime>='" + dtStartCreateTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (Request.QueryString["EndTime"] != null && Request.QueryString["EndTime"].ToString().Trim() != "" && Request.QueryString["EndTime"].ToString().Trim() != "null" && DateTime.TryParse(Request.QueryString["EndTime"].ToString().Trim(), out dtEndCreateTime))
                    whereEndCreateTime = "createTime<'" + dtEndCreateTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereDocNumber);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereSupplier);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereDirection);
                //whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereMaterialItem);

                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500); //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List<AscmStoreInOut> listAscmStoreInOut = AscmStoreInOutService.GetInstance().GetReportList(whereDocNumber);
               //var  res=listAscmStoreInOut.GroupBy(x=>new(x.docNumber,x.ascmContainer.specId,x.supplierId));
                ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("ContainerHistoryReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name = "DataSet1";
                rds1.Value = listAscmStoreInOut;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                //string companpyTitle = YnParameterService.GetInstance().GetValue(MyParameter.companpyTitle);
                string companpyTitle = "美的中央空调";
                string title = companpyTitle + "容器出入库报表打印";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title",title ),
                    new ReportParameter("ReportParameter_ReportTime","打印时间:"+DateTime.Now.ToString("yyyy-MM-dd") )
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
                //ReportViewer1.LocalReport.Refresh();
            }
        }
Beispiel #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                int    mainId     = 0;
                string whereOther = "";

                if (Request.QueryString["mainId"] != null && Request.QueryString["mainId"].Trim() != "" && Request.QueryString["mainId"].Trim() != "null")
                {
                    mainId = Convert.ToInt32(Request.QueryString["mainId"].Trim());
                }



                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500);  //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List <AscmWmsMtlReturnDetail> listAscmWmsMtlReturnDetail = AscmWmsMtlReturnDetailService.GetInstance().GetList(ynPage, "", "", mainId, "", whereOther);
                AscmWmsMtlReturnMain          ascmWmsMtlReturnMain       = AscmWmsMtlReturnMainService.GetInstance().Get(mainId);
                if (ascmWmsMtlReturnMain != null)
                {
                    ascmWmsMtlReturnMain.ascmWipEntities           = AscmWipEntitiesService.GetInstance().Get(ascmWmsMtlReturnMain.wipEntityId);
                    ascmWmsMtlReturnMain.ascmMtlTransactionReasons = AscmMtlTransactionReasonsService.GetInstance().Get(ascmWmsMtlReturnMain.reasonId);
                }


                ReportViewer1.ProcessingMode         = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("WmsJobMtlReturnDetialPrintReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name  = "DataSet1";
                rds1.Value = listAscmWmsMtlReturnDetail;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                string companpyTitle = "中央空调顺德工厂";
                string title         = companpyTitle + "作业退料单";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title", title),
                    new ReportParameter("ReportParameter_ReportTime", "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd")),
                    //new ReportParameter("ReportParameter_DocNumber", "单据号:" + ascmWmsMtlReturnMain.docNumber),
                    new ReportParameter("ReportParameter_ManualDocNumber", "作业号:" + ascmWmsMtlReturnMain.wipEntityName),
                    //new ReportParameter("ReportParameter_WarehouseId", "仓库:" + ascmWmsMtlReturnMain.warehouseId),
                    //new ReportParameter("ReportParameter_ReturnAreaCn", "退料区域:" + ascmWmsMtlReturnMain.returnAreaCn),
                    //new ReportParameter("ReportParameter_reasonName", "退料原因:" + ascmWmsMtlReturnMain.reasonName),
                    //new ReportParameter("ReportParameter_Memo", "备注:" + ascmWmsMtlReturnMain.memo),
                    new ReportParameter("ReportParameter_Memo", "打印人:" + ascmWmsMtlReturnMain.createUser)
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                string queryWord = ""; string wipEntityName = ""; string whereOther = "", whereStartModifyTime = "", whereEndModifyTime = "", whereWipEntityId="",whereBillType="";
                DateTime dtStartPlanTime, dtEndPlanTime;

                if (Request.QueryString["docNumber"] != null && Request.QueryString["docNumber"].Trim() != "" && Request.QueryString["docNumber"].Trim() != "null")
                    queryWord = Request.QueryString["docNumber"].Trim();
                if (Request.QueryString["wipEntityName"] != null && Request.QueryString["wipEntityName"].Trim() != "" && Request.QueryString["wipEntityName"].Trim() != "null")
                {
                    wipEntityName = Request.QueryString["wipEntityName"].Trim();
                    whereWipEntityId = " wipEntityId in(select wipEntityId from AscmWipEntities where name like %'" + wipEntityName + "%')";
                }
                if (!string.IsNullOrEmpty(Request.QueryString["queryStartModifyTime"]) && DateTime.TryParse(Request.QueryString["queryStartModifyTime"].Trim(), out dtStartPlanTime))
                    whereStartModifyTime = "modifyTime>='" + dtStartPlanTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(Request.QueryString["queryEndModifyTime"]) && DateTime.TryParse(Request.QueryString["queryEndModifyTime"].Trim(), out dtEndPlanTime))
                    whereEndModifyTime = "modifyTime<'" + dtEndPlanTime.ToString("yyyy-MM-dd 00:00:00") + "'";

                whereBillType = "billType='WIPENTITY'";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereBillType);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereWipEntityId);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartModifyTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndModifyTime);

                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500); //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List<AscmWmsMtlReturnMain> listAscmWmsMtlReturnMain = AscmWmsMtlReturnMainService.GetInstance().GetList(ynPage, "modifyTime", "asc", queryWord, whereOther);

                ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("WmsJobMtlReturnPrintReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name = "DataSet1";
                rds1.Value = listAscmWmsMtlReturnMain;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                string companpyTitle = "美的中央空调";
                string title = companpyTitle + "作业退料";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title", title),
                    new ReportParameter("ReportParameter_ReportTime", "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")),

                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
Beispiel #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                int mainId = 0;

                if (Request.QueryString["mainId"] != null && Request.QueryString["mainId"].Trim() != "" && Request.QueryString["mainId"].Trim() != "null")
                {
                    mainId = Convert.ToInt32(Request.QueryString["mainId"].Trim());
                }

                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500);  //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List <AscmWmsIncManAccDetail> listAscmWmsIncManAccDetail = AscmWmsIncManAccDetailService.GetInstance().GetList(mainId);
                AscmWmsIncManAccMain          ascmWmsIncManAccMain       = AscmWmsIncManAccMainService.GetInstance().Get(mainId);
                if (ascmWmsIncManAccMain != null)
                {
                    ascmWmsIncManAccMain.ascmSupplier        = AscmSupplierService.GetInstance().Get(ascmWmsIncManAccMain.supplierId);
                    ascmWmsIncManAccMain.ascmSupplierAddress = AscmSupplierAddressService.GetInstance().Get(ascmWmsIncManAccMain.supplierAddressId);
                }

                ReportViewer1.ProcessingMode         = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("WmsIncManAccDetailReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name  = "DataSet1";
                rds1.Value = listAscmWmsIncManAccDetail;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                string companpyTitle = "美的中央空调";
                string title         = companpyTitle + "送货单明细";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title", title),
                    new ReportParameter("ReportParameter_ReportTime", "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd")),
                    new ReportParameter("ReportParameter_DocNumber", "送货单号:" + ascmWmsIncManAccMain.docNumber),
                    new ReportParameter("ReportParameter_ResponsiblePerson", "责任人:" + ascmWmsIncManAccMain.responsiblePerson),
                    new ReportParameter("ReportParameter_CreateTimeShow", "生成时间:" + ascmWmsIncManAccMain.createTimeShow),
                    new ReportParameter("ReportParameter_SupplierDocNumber", "供方编码:" + ascmWmsIncManAccMain.supplierDocNumber),
                    new ReportParameter("ReportParameter_SupplierName", "供方名称:" + ascmWmsIncManAccMain.supplierName),
                    new ReportParameter("ReportParameter_WarehouseId", "收货仓库:" + ascmWmsIncManAccMain.warehouseId),
                    new ReportParameter("ReportParameter_SupperWarehouse", "供应子库:" + ascmWmsIncManAccMain.supperWarehouse),
                    new ReportParameter("ReportParameter_SupperPlateNumber", "运输车牌:" + ascmWmsIncManAccMain.supperPlateNumber),
                    new ReportParameter("ReportParameter_SupperTelephone", "联系电话:" + ascmWmsIncManAccMain.supperTelephone),
                    new ReportParameter("ReportParameter_Memo", "备注:" + ascmWmsIncManAccMain.memo),
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                int mainId= 0;

                string whereOther = "";

                if (Request.QueryString["mainId"] != null && Request.QueryString["mainId"].Trim() != "" && Request.QueryString["mainId"].Trim() != "null")
                    mainId = Convert.ToInt32(Request.QueryString["mainId"].Trim());

                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500); //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List<AscmWmsBackInvoiceDetail> listAscmWmsBackInvoiceDetail = AscmWmsBackInvoiceDetailService.GetInstance().GetList(ynPage, "", "", mainId, "", whereOther);
                AscmWmsBackInvoiceMain ascmWmsBackInvoiceMain = AscmWmsBackInvoiceMainService.GetInstance().Get(mainId);
                if (ascmWmsBackInvoiceMain != null)
                {
                    ascmWmsBackInvoiceMain.ascmSupplier = AscmSupplierService.GetInstance().Get(ascmWmsBackInvoiceMain.supplierId);
                }

                ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("WmsBackInvoiceDetailReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name = "DataSet1";
                rds1.Value = listAscmWmsBackInvoiceDetail;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                string companpyTitle = "美的中央空调";
                string title = companpyTitle + "供应商退货明细";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title", title),
                    new ReportParameter("ReportParameter_ReportTime", "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd")),
                    new ReportParameter("ReportParameter_DocNumber", "单据号:" + ascmWmsBackInvoiceMain.docNumber),
                    new ReportParameter("ReportParameter_ManualDocNumber", "手工单号:" + ascmWmsBackInvoiceMain.manualDocNumber),
                    new ReportParameter("ReportParameter_ResponsiblePerson", "责任人:" + ascmWmsBackInvoiceMain.responsiblePerson),
                    new ReportParameter("ReportParameter_WarehouseId", "默认仓库:" + ascmWmsBackInvoiceMain.warehouseId),
                    new ReportParameter("ReportParameter_StatusCn", "状态:" + ascmWmsBackInvoiceMain.statusCn),
                    new ReportParameter("ReportParameter_ReasonName", "退货原因:" + ascmWmsBackInvoiceMain.reasonName),
                    new ReportParameter("ReportParameter_SupplierDocNumber", "供方编码:" + ascmWmsBackInvoiceMain.supplierDocNumber),
                    new ReportParameter("ReportParameter_SupplierName", "供方名称:" + ascmWmsBackInvoiceMain.supplierName),
                    new ReportParameter("ReportParameter_Memo", "备注:" + ascmWmsBackInvoiceMain.memo),
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                string queryWord = "";
                string whereOther = "", whereDoor = "", wherePlateNumber = "";
                string whereStartCreateTime = "", whereEndCreateTime = "";

                if (Request.QueryString["queryWord"] != null && Request.QueryString["queryWord"].Trim() != "" && Request.QueryString["queryWord"].Trim() != "null")
                    queryWord = Request.QueryString["queryWord"].Trim();
                if (Request.QueryString["doorId"] != null && Request.QueryString["doorId"].Trim() != "" && Request.QueryString["doorId"].Trim() != "null")
                    whereDoor = "doorId=" + Request.QueryString["doorId"].Trim();
                if (Request.QueryString["plateNumber"] != null && Request.QueryString["plateNumber"].Trim() != "" && Request.QueryString["plateNumber"].Trim() != "null")
                    wherePlateNumber = "plateNumber like '%" + Request.QueryString["plateNumber"].Trim() + "%'";
                DateTime dtStartCreateTime, dtEndCreateTime;
                if (!string.IsNullOrEmpty(Request.QueryString["queryStartTime"]) && DateTime.TryParse(Request.QueryString["queryStartTime"], out dtStartCreateTime))
                    whereStartCreateTime = "createTime>='" + dtStartCreateTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(Request.QueryString["queryEndTime"]) && DateTime.TryParse(Request.QueryString["queryEndTime"], out dtEndCreateTime))
                    whereEndCreateTime = "createTime<'" + dtEndCreateTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereDoor);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, wherePlateNumber);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndCreateTime);

                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500); //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List<AscmTruckSwipeLog> listAscmTruckSwipeLog = AscmTruckSwipeLogService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);

                ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("TruckSwipeLogReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name = "DataSet1";
                rds1.Value = listAscmTruckSwipeLog;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                string companpyTitle = "美的中央空调";
                string title = companpyTitle + "供应商车辆出入日志";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title", title),
                    new ReportParameter("ReportParameter_ReportTime", "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd"))
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                int mainId = 0;

                if (Request.QueryString["mainId"] != null && Request.QueryString["mainId"].Trim() != "" && Request.QueryString["mainId"].Trim() != "null")
                    mainId = Convert.ToInt32(Request.QueryString["mainId"].Trim());

                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500); //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List<AscmWmsIncManAccDetail> listAscmWmsIncManAccDetail = AscmWmsIncManAccDetailService.GetInstance().GetList(mainId);
                AscmWmsIncManAccMain ascmWmsIncManAccMain = AscmWmsIncManAccMainService.GetInstance().Get(mainId);
                if (ascmWmsIncManAccMain != null)
                {
                    ascmWmsIncManAccMain.ascmSupplier = AscmSupplierService.GetInstance().Get(ascmWmsIncManAccMain.supplierId);
                    ascmWmsIncManAccMain.ascmSupplierAddress = AscmSupplierAddressService.GetInstance().Get(ascmWmsIncManAccMain.supplierAddressId);
                }

                ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("WmsIncManAccDetailReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name = "DataSet1";
                rds1.Value = listAscmWmsIncManAccDetail;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                string companpyTitle = "美的中央空调";
                string title = companpyTitle + "送货单明细";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title", title),
                    new ReportParameter("ReportParameter_ReportTime", "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd")),
                    new ReportParameter("ReportParameter_DocNumber", "送货单号:" + ascmWmsIncManAccMain.docNumber),
                    new ReportParameter("ReportParameter_ResponsiblePerson", "责任人:" + ascmWmsIncManAccMain.responsiblePerson),
                    new ReportParameter("ReportParameter_CreateTimeShow", "生成时间:" + ascmWmsIncManAccMain.createTimeShow),
                    new ReportParameter("ReportParameter_SupplierDocNumber", "供方编码:" + ascmWmsIncManAccMain.supplierDocNumber),
                    new ReportParameter("ReportParameter_SupplierName", "供方名称:" + ascmWmsIncManAccMain.supplierName),
                    new ReportParameter("ReportParameter_WarehouseId", "收货仓库:" + ascmWmsIncManAccMain.warehouseId),
                    new ReportParameter("ReportParameter_SupperWarehouse", "供应子库:" + ascmWmsIncManAccMain.supperWarehouse),
                    new ReportParameter("ReportParameter_SupperPlateNumber", "运输车牌:" + ascmWmsIncManAccMain.supperPlateNumber),
                    new ReportParameter("ReportParameter_SupperTelephone", "联系电话:" + ascmWmsIncManAccMain.supperTelephone),
                    new ReportParameter("ReportParameter_Memo", "备注:" + ascmWmsIncManAccMain.memo),
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                int mainId = 0;
                string whereOther = "";

                if (Request.QueryString["mainId"] != null && Request.QueryString["mainId"].Trim() != "" && Request.QueryString["mainId"].Trim() != "null")
                    mainId = Convert.ToInt32(Request.QueryString["mainId"].Trim());

                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500); //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List<AscmWmsMtlReturnDetail> listAscmWmsMtlReturnDetail = AscmWmsMtlReturnDetailService.GetInstance().GetList(ynPage, "", "", mainId, "", whereOther);
                AscmWmsMtlReturnMain ascmWmsMtlReturnMain = AscmWmsMtlReturnMainService.GetInstance().Get(mainId);
                if(ascmWmsMtlReturnMain!=null)
                {
                    ascmWmsMtlReturnMain.ascmWipEntities = AscmWipEntitiesService.GetInstance().Get(ascmWmsMtlReturnMain.wipEntityId);
                    ascmWmsMtlReturnMain.ascmMtlTransactionReasons = AscmMtlTransactionReasonsService.GetInstance().Get(ascmWmsMtlReturnMain.reasonId);
                }

                ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("WmsJobMtlReturnDetialPrintReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name = "DataSet1";
                rds1.Value = listAscmWmsMtlReturnDetail;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                string companpyTitle = "中央空调顺德工厂";
                string title = companpyTitle + "作业退料单";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title", title),
                    new ReportParameter("ReportParameter_ReportTime", "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd")),
                    //new ReportParameter("ReportParameter_DocNumber", "单据号:" + ascmWmsMtlReturnMain.docNumber),
                    new ReportParameter("ReportParameter_ManualDocNumber", "作业号:" + ascmWmsMtlReturnMain.wipEntityName),
                    //new ReportParameter("ReportParameter_WarehouseId", "仓库:" + ascmWmsMtlReturnMain.warehouseId),
                    //new ReportParameter("ReportParameter_ReturnAreaCn", "退料区域:" + ascmWmsMtlReturnMain.returnAreaCn),
                    //new ReportParameter("ReportParameter_reasonName", "退料原因:" + ascmWmsMtlReturnMain.reasonName),
                    //new ReportParameter("ReportParameter_Memo", "备注:" + ascmWmsMtlReturnMain.memo),
                    new ReportParameter("ReportParameter_Memo", "打印人:" + ascmWmsMtlReturnMain.createUser)
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                string queryWord = "", supplierDoc = "";
                string whereOther = "", whereStartModifyTime = "", whereEndModifyTime = "";
                DateTime dtStartPlanTime, dtEndPlanTime;

                if (Request.QueryString["queryWord"] != null && Request.QueryString["queryWord"].Trim() != "" && Request.QueryString["queryWord"].Trim() != "null")
                    queryWord = Request.QueryString["queryWord"].Trim();
                if (Request.QueryString["supplierDoc"] != null && Request.QueryString["supplierDoc"].Trim() != "" && Request.QueryString["supplierDoc"].Trim() != "null")
                    supplierDoc = Request.QueryString["supplierDoc"].Trim();
                if (!string.IsNullOrEmpty(Request.QueryString["queryStartModifyTime"]) && DateTime.TryParse(Request.QueryString["queryStartModifyTime"].Trim(), out dtStartPlanTime))
                    whereStartModifyTime = "modifyTime>='" + dtStartPlanTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(Request.QueryString["queryEndModifyTime"]) && DateTime.TryParse(Request.QueryString["queryEndModifyTime"].Trim(), out dtEndPlanTime))
                    whereEndModifyTime = "modifyTime<'" + dtEndPlanTime.ToString("yyyy-MM-dd 00:00:00") + "'";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartModifyTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndModifyTime);

                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500); //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List<AscmWmsBackInvoiceMain> listAscmWmsBackInvoiceMain = AscmWmsBackInvoiceMainService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                if (!string.IsNullOrEmpty(supplierDoc))
                    listAscmWmsBackInvoiceMain = listAscmWmsBackInvoiceMain.Where(item => item.ascmSupplier.docNumber == supplierDoc).OrderBy(item => item.modifyTime).ToList();

                ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("WmsBackInvoiceReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name = "DataSet1";
                rds1.Value = listAscmWmsBackInvoiceMain;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                string companpyTitle = "美的中央空调";
                string title = companpyTitle + "供应商退货";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title", title),
                    new ReportParameter("ReportParameter_ReportTime", "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"))
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
Beispiel #23
0
        private List <AscmWipDiscreteJobs> getWipDiscreteJobsList(ref int count)
        {
            List <AscmWipDiscreteJobs> listJobs = null;
            string message = string.Empty;
            string _ynPage = string.Empty;

            try
            {
                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(pageControlJob.PageSize);
                ynPage.SetCurrentPage((pageControlJob.PageCurrent <= 0) ? 1 : pageControlJob.PageCurrent);
                _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage);

                string startdate = startDate.Value.ToString("yyyy-MM-dd");
                string enddate   = endDate.Value.ToString("yyyy-MM-dd");

                AscmWebService.AscmWebService service = new AscmWebService.AscmWebService();
                string jsonstr = service.MaterialOfDiscreteJobList(frmMain.encryptTicket, materialId, startdate, enddate, ref _ynPage, ref message);
                if (!string.IsNullOrEmpty(jsonstr))
                {
                    listJobs = (List <AscmWipDiscreteJobs>)JsonConvert.DeserializeObject(jsonstr, typeof(List <AscmWipDiscreteJobs>));
                    if (listJobs != null && listJobs.Count > 0)
                    {
                        ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage);
                        count  = ynPage.GetRecordCount();
                    }
                    else
                    {
                        MessageBoxEx.Show("没有查询到符合条件的作业!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message + message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(listJobs);
        }
Beispiel #24
0
        private List<AscmWipRequirementOperations> GetWipRequirementOperations(ref int count)
        {
            List<AscmWipRequirementOperations> list = null;
            string message = string.Empty;
            string _ynPage = string.Empty;

            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(pageControlMaterial.PageSize);
            ynPage.SetCurrentPage((pageControlMaterial.PageCurrent <= 0) ? 1 : pageControlMaterial.PageCurrent);
            _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage);

            try
            {
                if (!string.IsNullOrEmpty(GetMaterialTaskId) && !string.IsNullOrEmpty(DiscreteJobsId))
                {
                    WinForm.AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService();
                    string jsonStr = Service.GetMtlList(frmMain.encryptTicket, GetMaterialTaskId, DiscreteJobsId, ref _ynPage, ref message);
                    if (!string.IsNullOrEmpty(jsonStr))
                    {
                        list = (List<AscmWipRequirementOperations>)JsonConvert.DeserializeObject(jsonStr, typeof(List<AscmWipRequirementOperations>));
                        if (list != null && list.Count > 0)
                        {
                            ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage);
                            count = ynPage.GetRecordCount();
                        }
                        else
                        {
                            MessageBoxEx.Show("没有查询到符合条件的领料任务!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return list;
        }
Beispiel #25
0
        private List<AscmWipDiscreteJobs> getWipDiscreteJobsList(ref int count)
        {
            List<AscmWipDiscreteJobs> listJobs = null;
            string message = string.Empty;
            string _ynPage = string.Empty;

            try
            {
                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(pageControlJob.PageSize);
                ynPage.SetCurrentPage((pageControlJob.PageCurrent <= 0) ? 1 : pageControlJob.PageCurrent);
                _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage);

                string startdate = startDate.Value.ToString("yyyy-MM-dd");
                string enddate = endDate.Value.ToString("yyyy-MM-dd");

                AscmWebService.AscmWebService service = new AscmWebService.AscmWebService();
                string jsonstr = service.MaterialOfDiscreteJobList(frmMain.encryptTicket, materialId, startdate, enddate, ref _ynPage, ref message);
                if (!string.IsNullOrEmpty(jsonstr))
                {
                    listJobs = (List<AscmWipDiscreteJobs>)JsonConvert.DeserializeObject(jsonstr, typeof(List<AscmWipDiscreteJobs>));
                    if (listJobs != null && listJobs.Count > 0)
                    {
                        ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage);
                        count = ynPage.GetRecordCount();
                    }
                    else
                    {
                        MessageBoxEx.Show("没有查询到符合条件的作业!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message + message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return listJobs;
        }
Beispiel #26
0
        private List <AscmWipRequirementOperations> GetWipRequirementOperations(ref int count)
        {
            List <AscmWipRequirementOperations> list = null;
            string message = string.Empty;
            string _ynPage = string.Empty;

            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(pageControlMaterial.PageSize);
            ynPage.SetCurrentPage((pageControlMaterial.PageCurrent <= 0) ? 1 : pageControlMaterial.PageCurrent);
            _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage);

            try
            {
                if (!string.IsNullOrEmpty(GetMaterialTaskId) && !string.IsNullOrEmpty(DiscreteJobsId))
                {
                    WinForm.AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService();
                    string jsonStr = Service.GetMtlList(frmMain.encryptTicket, GetMaterialTaskId, DiscreteJobsId, ref _ynPage, ref message);
                    if (!string.IsNullOrEmpty(jsonStr))
                    {
                        list = (List <AscmWipRequirementOperations>)JsonConvert.DeserializeObject(jsonStr, typeof(List <AscmWipRequirementOperations>));
                        if (list != null && list.Count > 0)
                        {
                            ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage);
                            count  = ynPage.GetRecordCount();
                        }
                        else
                        {
                            MessageBoxEx.Show("没有查询到符合条件的领料任务!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(list);
        }
Beispiel #27
0
        public ActionResult EmployeeCarSwipeLogList(int? page, int? rows, string sort, string order, string queryWord, int? doorId,
            string direction, string plateNumber, string employeeName, string queryStartTime, string queryEndTime)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = string.Empty;
                if (doorId.HasValue)
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, "doorId=" + doorId);
                if (!string.IsNullOrEmpty(direction))
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, "direction='" + direction + "'");
                if (!string.IsNullOrEmpty(plateNumber))
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, "plateNumber like '%" + plateNumber.Trim() + "%'");
                if (!string.IsNullOrEmpty(employeeName))
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, "employeeName like '%" + employeeName.Trim() + "%'");
                DateTime dtStartCreateTime, dtEndCreateTime;
                if (!string.IsNullOrEmpty(queryStartTime) && DateTime.TryParse(queryStartTime, out dtStartCreateTime))
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, "createTime>='" + dtStartCreateTime.ToString("yyyy-MM-dd 00:00:00") + "'");
                if (!string.IsNullOrEmpty(queryEndTime) && DateTime.TryParse(queryEndTime, out dtEndCreateTime))
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, "createTime<'" + dtEndCreateTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'");

                List<AscmEmpCarSwipeLog> list = AscmEmpCarSwipeLogService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                if (list != null)
                    list.ForEach(P => jsonDataGridResult.rows.Add(P));

                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
Beispiel #28
0
        private List<AscmWipRequirementOperations> DataBindDataGridView(ref int count)
        {
            List<AscmWipRequirementOperations> list = null;
            string message = string.Empty;
            string _ynPage = string.Empty;

            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(pagerControlMaterial.PageSize);
            ynPage.SetCurrentPage((pagerControlMaterial.PageCurrent <= 0) ? 1 : pagerControlMaterial.PageCurrent);
            _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage);

            try
            {
                if (taskId != 0 && jobId != 0)
                {
                    AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService();
                    //string jsonString = Service.GetMonistorMaterialList(frmMainView.encryptTicket, taskId.ToString(), jobId.ToString(), ref _ynPage, ref message);
                    string jsonString = Service.GetMonitorMaterialList(frmMainView.encryptTicket, taskId.ToString(), jobId.ToString(), tbItemWarehouse.Text, tbItemMtlCategory.Text, ref _ynPage, ref message);
                    if (!string.IsNullOrEmpty(jsonString))
                    {
                        list = (List<AscmWipRequirementOperations>)JsonConvert.DeserializeObject(jsonString,typeof(List<AscmWipRequirementOperations>));
                        if (list != null && list.Count > 0)
                        {
                            ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage);
                            count = ynPage.GetRecordCount();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return list;
        }
Beispiel #29
0
        private List <AscmWipRequirementOperations> DataBindDataGridView(ref int count)
        {
            List <AscmWipRequirementOperations> list = null;
            string message = string.Empty;
            string _ynPage = string.Empty;

            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(pagerControlMaterial.PageSize);
            ynPage.SetCurrentPage((pagerControlMaterial.PageCurrent <= 0) ? 1 : pagerControlMaterial.PageCurrent);
            _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage);

            try
            {
                if (taskId != 0 && jobId != 0)
                {
                    AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService();
                    //string jsonString = Service.GetMonistorMaterialList(frmMainView.encryptTicket, taskId.ToString(), jobId.ToString(), ref _ynPage, ref message);
                    string jsonString = Service.GetMonitorMaterialList(frmMainView.encryptTicket, taskId.ToString(), jobId.ToString(), tbItemWarehouse.Text, tbItemMtlCategory.Text, ref _ynPage, ref message);
                    if (!string.IsNullOrEmpty(jsonString))
                    {
                        list = (List <AscmWipRequirementOperations>)JsonConvert.DeserializeObject(jsonString, typeof(List <AscmWipRequirementOperations>));
                        if (list != null && list.Count > 0)
                        {
                            ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage);
                            count  = ynPage.GetRecordCount();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(list);
        }
Beispiel #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                string queryWord = "";

                if (Request.QueryString["queryWord"] != null && Request.QueryString["queryWord"].Trim() != "" && Request.QueryString["queryWord"].Trim() != "null")
                {
                    queryWord = Request.QueryString["queryWord"].Trim();
                }

                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500);  //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List <AscmSupplier> listAscmSupplier = AscmSupplierService.GetInstance().GetList(ynPage, "", "", queryWord, null);
                ReportViewer1.ProcessingMode         = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("SupplierReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name  = "DataSet1";
                rds1.Value = listAscmSupplier;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                string companpyTitle = "美的中央空调";
                string title         = companpyTitle + "供应商";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title", title),
                    new ReportParameter("ReportParameter_ReportTime", "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"))
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
Beispiel #31
0
        public ActionResult DeliveryOrderMainList(int? page, int? rows, string sort, string order, string queryWord,
            string supplier, string warehouse, string startDeliveryTime, string endDeliveryTime, string status)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmDeliveryOrderMain> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = "", whereSupplier = "", whereWarehouse="";
                string whereStartDeliveryTime = "", whereEndDeliveryTime = "", whereStatus = "";

                if (!string.IsNullOrEmpty(supplier))
                    whereSupplier = "supplierId=" + supplier;
                if (!string.IsNullOrEmpty(warehouse))
                    whereWarehouse = "warehouseId = '" + warehouse + "'";
                if (!string.IsNullOrEmpty(status))
                    whereStatus = "status = '" + status + "'";

                DateTime dtStartDeliveryTime, dtEndDeliveryTime;
                if (!string.IsNullOrEmpty(startDeliveryTime) && DateTime.TryParse(startDeliveryTime, out dtStartDeliveryTime))
                    whereStartDeliveryTime = "deliveryTime>='" + dtStartDeliveryTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(endDeliveryTime) && DateTime.TryParse(endDeliveryTime, out dtEndDeliveryTime))
                    whereEndDeliveryTime = "deliveryTime<'" + dtEndDeliveryTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereSupplier);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereWarehouse);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartDeliveryTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndDeliveryTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStatus);
                //whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereMaterialItem);

                list = AscmDeliveryOrderMainService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                foreach (AscmDeliveryOrderMain ascmDeliveryOrderMain in list)
                {
                    jsonDataGridResult.rows.Add(ascmDeliveryOrderMain.GetOwner());
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
Beispiel #32
0
        public ActionResult DeliveryNotifyMainList(int? page, int? rows, string sort, string order, string queryWord,
            string supplier, string materialItem, string warehouse, string alert, string filter, string startReleasedTime, string endReleasedTime, string startNeedTime, string endNeedTime, string status, string employeeBuyer, string wipEntityIds)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmDeliveryNotifyMain> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = "", whereSupplier = "", whereMaterialItem = "", whereWarehouse = "", whereAlert = "", whereFilter = "", whereStartReleaseTime = "", whereEndReleaseTime = "";
                string whereStartNeedTime = "", whereEndNeedTime = "", whereStatus = "", whereEmployeeBuyer = "", whereWipEntityIds = "";
                if (!string.IsNullOrEmpty(supplier))
                    whereSupplier = "a.supplierId=" + supplier;
                if (!string.IsNullOrEmpty(materialItem))
                    whereMaterialItem = "a.materialId= " + materialItem;
                if (!string.IsNullOrEmpty(warehouse))
                    whereWarehouse = "a.warehouseId = '" + warehouse + "'";
                if (!string.IsNullOrEmpty(alert))
                {
                    string datetime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    if (alert == AscmDeliveryNotifyMain.AlertDefine.alert)
                    {
                        whereAlert = "a.appointmentStartTime <='" + datetime + "' and a.appointmentEndTime >= '" + datetime + "'";
                    }
                    if (alert == AscmDeliveryNotifyMain.AlertDefine.overdue)
                    {
                        whereAlert = "a.appointmentEndTime < '" + datetime + "'";
                    }
                }
                //if (!string.IsNullOrEmpty(filter))
                //{
                //    whereFilter = "e.receivedQuantity < a.releasedquantity";
                //}

                if (!string.IsNullOrEmpty(filter))
                    whereFilter = "a.totalReceiveQuantity < a.releasedQuantity";

                if (!string.IsNullOrEmpty(wipEntityIds))
                    whereWipEntityIds = "a.wipEntityId > 0";

                if (!string.IsNullOrEmpty(status))
                    whereStatus = "status = '" + status + "'";

                if (!string.IsNullOrEmpty(employeeBuyer))
                    whereEmployeeBuyer = "a.materialId in (select id from Ascm_Material_Item where Ascm_Material_Item.buyerId=" + employeeBuyer + ")";

                DateTime dtStartReleasedTime,dtEndReleasedTime;
                if (!string.IsNullOrEmpty(startReleasedTime) && DateTime.TryParse(startReleasedTime, out dtStartReleasedTime))
                    whereStartReleaseTime = "a.releasedTime>='" + dtStartReleasedTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(endReleasedTime) && DateTime.TryParse(endReleasedTime, out dtEndReleasedTime))
                    whereEndReleaseTime = "a.releasedTime<'" + dtEndReleasedTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";

                DateTime dtStartNeedTime, dtEndNeedTime;
                if (!string.IsNullOrEmpty(startNeedTime) && DateTime.TryParse(startNeedTime, out dtStartNeedTime))
                    whereStartNeedTime = "a.needTime>='" + dtStartNeedTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(endReleasedTime) && DateTime.TryParse(endNeedTime, out dtEndNeedTime))
                    whereEndNeedTime = "a.needTime<'" + dtEndNeedTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereSupplier);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereMaterialItem);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereWarehouse);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereAlert);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereFilter);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartReleaseTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndReleaseTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartNeedTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndNeedTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStatus);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEmployeeBuyer);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereWipEntityIds);

                list = AscmDeliveryNotifyMainService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                foreach (AscmDeliveryNotifyMain ascmDeliveryNotifyMain in list)
                {
                    jsonDataGridResult.rows.Add(ascmDeliveryNotifyMain.GetOwner());
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
Beispiel #33
0
        public ActionResult DeliveryOrderBatchAscxList1(int? page, int? rows, string sort, string order, string queryWord,
           string supplier, string warehouse, string startCreateTime, string endCreateTime, string status, string ascmStatus,
            string startConfirmDate, string endConfirmDate, string startNotifyDate, string endNotifyDate, string startMaterialDocNumber, string endMaterialDocNumber,
            string appointmentStartTime, string appointmentEndTime, string queryFilter, bool? isSupplierSelect, int? supplierDeliveryBatSumId, bool appointmentTimeFilter)
        {
            //isSupplierSelect是否供应商选择批单方式,如果是则不显示已生成的批单
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = "", whereSupplier = "", whereWarehouse = "", whereAscmStatus = "";//whereBatSumMain = "",
                string whereStartCreateTime = "", whereEndCreateTime = "", whereStatus = "";

                if (!string.IsNullOrEmpty(supplier) && supplier != "null")
                    whereSupplier = "supplierId=" + supplier;
                if (!string.IsNullOrEmpty(warehouse) && warehouse != "null")
                    whereWarehouse = "warehouseId = '" + warehouse + "'";
                if (!string.IsNullOrEmpty(status))
                    whereStatus = "status = '" + status + "'";

                DateTime dtStartCreateTime, dtEndCreateTime;
                if (!string.IsNullOrEmpty(startCreateTime) && DateTime.TryParse(startCreateTime, out dtStartCreateTime))
                    whereStartCreateTime = "createTime>='" + dtStartCreateTime.ToString("yyyy-MM-dd HH:mm:00") + "'";
                if (!string.IsNullOrEmpty(endCreateTime) && DateTime.TryParse(endCreateTime, out dtEndCreateTime))
                    //whereEndCreateTime = "createTime<'" + dtEndCreateTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";
                    whereEndCreateTime = "createTime<='" + dtEndCreateTime.ToString("yyyy-MM-dd HH:mm:00") + "'";

                if (!string.IsNullOrEmpty(ascmStatus))
                {
                    if (ascmStatus == "INSTORAGE")
                        if (ascmStatus == AscmDeliveryOrderBatch.AscmStatusDefine.inStorage)
                            whereAscmStatus = "ascmStatus='" + ascmStatus + "'";
                        else
                            whereAscmStatus = " ascmStatus is null or ascmStatus<>'" + AscmDeliveryOrderBatch.AscmStatusDefine.inStorage + "'";
                }

                #region 物料编码
                string whereStartMaterialId = "", whereEndMaterialId = "";
                if (startMaterialDocNumber != null && startMaterialDocNumber != "")
                {
                    whereStartMaterialId = "id in (select batchId from AscmDeliveryOrderMain where id in(select mainId from AscmDeliveryOrderDetail where materialId in(select id from AscmMaterialItem where docNumber='" + startMaterialDocNumber.Trim() + "')))";
                }
                if (endMaterialDocNumber != null && endMaterialDocNumber != "")
                {
                    if (startMaterialDocNumber != null && startMaterialDocNumber != "")
                    {
                        whereStartMaterialId = "id in (select batchId from AscmDeliveryOrderMain where id in(select mainId from AscmDeliveryOrderDetail where materialId  in(select id from AscmMaterialItem where docNumber>='" + startMaterialDocNumber.Trim() + "' and docNumber<='" + endMaterialDocNumber.Trim() + "')))";
                    }
                    else
                    {
                        whereEndMaterialId = "id in (select batchId from AscmDeliveryOrderMain where id in(select mainId from AscmDeliveryOrderDetail where materialId in(select id from AscmMaterialItem where docNumber<='" + endMaterialDocNumber.Trim() + "')))";
                    }
                }
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartMaterialId);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndMaterialId);
                #endregion

                #region 确认时间
                string whereStartConfirmDate = "", whereEndConfirmDate = "";
                DateTime dtStartConfirmDate, dtEndConfirmDate;
                if (!string.IsNullOrEmpty(startConfirmDate) && DateTime.TryParse(startConfirmDate, out dtStartConfirmDate))
                    whereStartConfirmDate = "id in(select batchId from AscmDeliveryOrderMain where id in (select mainId from AscmDeliveryOrderDetail where notifyDetailId in (select id from AscmDeliveryNotifyDetail where mainId in (select id from AscmDeliveryNotifyMain where confirmTime>='" + dtStartConfirmDate.ToString("yyyy-MM-dd 00:00:00") + "'))))";
                if (!string.IsNullOrEmpty(endConfirmDate) && DateTime.TryParse(endConfirmDate, out dtEndConfirmDate))
                    whereEndConfirmDate = "id in(select batchId from AscmDeliveryOrderMain where id in (select mainId from AscmDeliveryOrderDetail where notifyDetailId in (select id from AscmDeliveryNotifyDetail where mainId in (select id from AscmDeliveryNotifyMain where confirmTime<'" + dtEndConfirmDate.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'))))";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartConfirmDate);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndConfirmDate);
                #endregion

                #region 通知时间
                string whereStartNotifyDate = "", whereEndNotifyDate = "";
                DateTime dtStartNotifyDate, dtEndNotifyDate;
                if (!string.IsNullOrEmpty(startNotifyDate) && DateTime.TryParse(startNotifyDate, out dtStartNotifyDate))
                    whereStartNotifyDate = "id in(select batchId from AscmDeliveryOrderMain where id in (select mainId from AscmDeliveryOrderDetail where notifyDetailId in (select id from AscmDeliveryNotifyDetail where mainId in (select id from AscmDeliveryNotifyMain where releasedTime>='" + dtStartNotifyDate.ToString("yyyy-MM-dd 00:00:00") + "'))))";
                if (!string.IsNullOrEmpty(endNotifyDate) && DateTime.TryParse(endNotifyDate, out dtEndNotifyDate))
                    whereEndNotifyDate = "id in(select batchId from AscmDeliveryOrderMain where id in (select mainId from AscmDeliveryOrderDetail where notifyDetailId in (select id from AscmDeliveryNotifyDetail where mainId in (select id from AscmDeliveryNotifyMain where releasedTime<'" + dtEndNotifyDate.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'))))";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartNotifyDate);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndNotifyDate);
                #endregion

                #region 预约时间
                DateTime dtAppointmentStartTime, dtAppointmentEndTime;
                string _appointmentStartTime = appointmentStartTime;
                string _appointmentEndTime = appointmentEndTime;
                if (!string.IsNullOrEmpty(_appointmentEndTime) && DateTime.TryParse(_appointmentEndTime, out dtAppointmentEndTime))
                {
                    _appointmentEndTime = dtAppointmentEndTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00");
                }
                AscmDeliBatSumMain ascmDeliBatSumMain = null;
                if (supplierDeliveryBatSumId.HasValue)
                {
                    ascmDeliBatSumMain = AscmDeliBatSumMainService.GetInstance().Get(supplierDeliveryBatSumId.Value);
                    //ascmDeliBatSumMain.appointmentStartTime = "2013-11-20 09:00";
                    //ascmDeliBatSumMain.appointmentEndTime = "2013-11-20 10:00";
                    DateTime dtSumMainStartTime, dtSumMainEndTime;
                    DateTime dtTmp;
                    if (DateTime.TryParse(ascmDeliBatSumMain.appointmentStartTime, out dtSumMainStartTime) && DateTime.TryParse(ascmDeliBatSumMain.appointmentEndTime, out dtSumMainEndTime))
                    {
                        if (!string.IsNullOrEmpty(_appointmentStartTime) && DateTime.TryParse(_appointmentStartTime, out dtTmp))
                        {
                            if (dtTmp < dtSumMainStartTime)
                                _appointmentStartTime = dtSumMainStartTime.ToString("yyyy-MM-dd HH:mm");
                        }
                        if (!string.IsNullOrEmpty(_appointmentEndTime) && DateTime.TryParse(_appointmentEndTime, out dtTmp))
                        {
                            if (dtTmp > dtSumMainEndTime)
                                _appointmentEndTime = dtSumMainEndTime.ToString("yyyy-MM-dd HH:mm");
                        }
                    }
                    //2013.11.28对相同司机合单进行判断
                    List<AscmDeliBatSumMain> listAscmDeliBatSumMain = AscmDeliBatSumMainService.GetInstance().GetList("from AscmDeliBatSumMain where id<>" + ascmDeliBatSumMain.id + " and driverId=" + ascmDeliBatSumMain.driverId + " and status='" + AscmDeliBatSumMain.StatusDefine.unConfirm + "'");
                    foreach (AscmDeliBatSumMain ascmDeliBatSumMain_Other in listAscmDeliBatSumMain)
                    {
                        DateTime dtSumMainStartTime_Other, dtSumMainEndTime_Other;
                        if (DateTime.TryParse(ascmDeliBatSumMain_Other.appointmentStartTime, out dtSumMainStartTime_Other) && DateTime.TryParse(ascmDeliBatSumMain_Other.appointmentEndTime, out dtSumMainEndTime_Other))
                        {
                            if (!string.IsNullOrEmpty(_appointmentStartTime) && DateTime.TryParse(_appointmentStartTime, out dtTmp))
                            {
                                if (dtTmp < dtSumMainStartTime_Other)
                                    _appointmentStartTime = dtSumMainStartTime_Other.ToString("yyyy-MM-dd HH:mm");
                            }
                            if (!string.IsNullOrEmpty(_appointmentEndTime) && DateTime.TryParse(_appointmentEndTime, out dtTmp))
                            {
                                if (dtTmp > dtSumMainEndTime_Other)
                                    _appointmentEndTime = dtSumMainEndTime_Other.ToString("yyyy-MM-dd HH:mm");
                            }
                        }
                    }
                    //5)	最晚到货时间早于当前时间的批单,该批单总是可以勾选入合单
                    if (!string.IsNullOrEmpty(_appointmentEndTime) && DateTime.TryParse(_appointmentEndTime, out dtTmp))
                    {
                        if (dtTmp < DateTime.Now)
                        {
                            _appointmentStartTime = null;
                            _appointmentEndTime = null;
                        }
                    }
                }
                if (appointmentTimeFilter)
                {
                    string whereAppointment = "";
                    //if (!string.IsNullOrEmpty(_appointmentStartTime) && DateTime.TryParse(_appointmentStartTime, out dtAppointmentStartTime))
                    //    whereAppointment = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereAppointment, "appointmentStartTime>='" + dtAppointmentStartTime.ToString("yyyy-MM-dd HH:mm") + "'");
                    //if (!string.IsNullOrEmpty(_appointmentEndTime) && DateTime.TryParse(_appointmentEndTime, out dtAppointmentEndTime))
                    //    whereAppointment = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereAppointment, "appointmentEndTime<='" + dtAppointmentEndTime.ToString("yyyy-MM-dd HH:mm") + "'");
                    if (!string.IsNullOrEmpty(_appointmentStartTime) && DateTime.TryParse(_appointmentStartTime, out dtAppointmentStartTime) &&
                       !string.IsNullOrEmpty(_appointmentEndTime) && DateTime.TryParse(_appointmentEndTime, out dtAppointmentEndTime))
                    {
                        whereAppointment = "((appointmentEndTime between '" + dtAppointmentStartTime.ToString("yyyy-MM-dd HH:mm") + "' and '" + dtAppointmentEndTime.ToString("yyyy-MM-dd HH:mm") + "') or ";
                        whereAppointment += "(appointmentStartTime between '" + dtAppointmentStartTime.ToString("yyyy-MM-dd HH:mm") + "' and '" + dtAppointmentEndTime.ToString("yyyy-MM-dd HH:mm") + "' ) or ";
                        whereAppointment += "('" + dtAppointmentStartTime.ToString("yyyy-MM-dd HH:mm") + "' between appointmentStartTime and appointmentEndTime ) or ";
                        whereAppointment += "('" + dtAppointmentEndTime.ToString("yyyy-MM-dd HH:mm") + "' between appointmentStartTime and appointmentEndTime ))";
                    }
                    if (whereAppointment != "")
                    {
                        whereAppointment = "(" + whereAppointment + ") or appointmentStartTime=appointmentEndTime or appointmentEndTime<'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "'";
                        whereAppointment = "id in(select batchId from AscmDeliveryOrderMain where id in (select mainId from AscmDeliveryOrderDetail where notifyDetailId in (select id from AscmDeliveryNotifyDetail where mainId in (select id from AscmDeliveryNotifyMain where " + whereAppointment + "))))";
                        whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereAppointment);
                    }
                    //whereAscmStatus = " ascmStatus is null or ascmStatus<>'" + AscmDeliveryOrderBatch.AscmStatusDefine.inStorage + "'";
                    //whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, "ascmStatus<>'" + AscmDeliveryOrderBatch.AscmStatusDefine.inStorage + "'");
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, "ascmStatus is null or ascmStatus=''");
                }

                //whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereAppointmentEndTime);
                #endregion

                #region 已经完成批单不能显示
                if (isSupplierSelect.HasValue)
                {
                    //whereBatSumMain = " select * from AscmDeliBatSumMain where status in ('" + AscmDeliBatSumMain.StatusDefine.unConfirm + "','" + AscmDeliBatSumMain.StatusDefine.confirm + "')";
                    //whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereAscmStatus);
                }
                if (supplierDeliveryBatSumId.HasValue)
                {
                    if (string.IsNullOrEmpty(queryFilter))
                    {
                        //string whereBatSumMain = " id not in (select batchId from AscmDeliBatSumDetail where mainId in (select id from AscmDeliBatSumMain where driverId=" + ascmDeliBatSumMain.driverId + "))";
                        string whereBatSumMain = " id not in (select batchId from AscmDeliBatSumDetail)";
                        whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereBatSumMain);
                    }
                }
                #endregion

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereSupplier);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereWarehouse);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStatus);
                //whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereBatSumMain);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereAscmStatus);

                List<AscmDeliveryOrderBatch> list = AscmDeliveryOrderBatchService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                if (list != null)
                {
                    AscmDeliveryOrderBatchService.GetInstance().SetDeliveryNotifyMain(list);
                    if (!string.IsNullOrEmpty(sort) && sort.ToLower() == "appointmentEndTime".ToLower())
                    {
                        list = list.OrderBy(p => p.appointmentEndTime).ToList();
                    }
                    else if (!string.IsNullOrEmpty(sort) && sort.ToLower() == "warehouseId".ToLower())
                    {
                        list = list.OrderBy(p => p.warehouseId).ToList();
                    }

                    foreach (AscmDeliveryOrderBatch ascmDeliveryOrderBatch in list)
                    {
                        jsonDataGridResult.rows.Add(ascmDeliveryOrderBatch.GetOwner());
                    }
                    jsonDataGridResult.total = ynPage.GetRecordCount();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
Beispiel #34
0
        public ActionResult DeliveryOrderBatchNotInBatchSumList(int? page, int? rows, string sort, string order, string queryWord,
            string supplier, string warehouse, string startCreateTime, string endCreateTime, string status, string ascmStatus)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = "", whereSupplier = "", whereWarehouse = "", whereAscmStatus = "";
                string whereStartCreateTime = "", whereEndCreateTime = "", whereStatus = "";
                string whereNotInSum = " id not in(select batchId from AscmDeliBatSumDetail where mainId in(select id from AscmDeliBatSumMain where status='" + AscmDeliBatSumMain.StatusDefine.unConfirm + "'))";

                if (!string.IsNullOrEmpty(supplier))
                    whereSupplier = "supplierId=" + supplier;
                if (!string.IsNullOrEmpty(warehouse))
                    whereWarehouse = "warehouseId = '" + warehouse + "'";
                if (!string.IsNullOrEmpty(status))
                    whereStatus = "status = '" + status + "'";

                DateTime dtStartCreateTime, dtEndCreateTime;
                if (!string.IsNullOrEmpty(startCreateTime) && DateTime.TryParse(startCreateTime, out dtStartCreateTime))
                    whereStartCreateTime = "createTime>='" + dtStartCreateTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(endCreateTime) && DateTime.TryParse(endCreateTime, out dtEndCreateTime))
                    whereEndCreateTime = "createTime<'" + dtEndCreateTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(ascmStatus))
                {
                    if (ascmStatus == "INSTORAGE")
                        whereAscmStatus = "ascmStatus='" + ascmStatus + "'";
                    else
                        whereAscmStatus = "ascmStatus!='INSTORAGE'  or ascmStatus is null";
                }

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereSupplier);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereWarehouse);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStatus);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereNotInSum);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereAscmStatus);

                List<AscmDeliveryOrderBatch> list = AscmDeliveryOrderBatchService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                if (list != null)
                {
                    foreach (AscmDeliveryOrderBatch ascmDeliveryOrderBatch in list)
                    {
                        jsonDataGridResult.rows.Add(ascmDeliveryOrderBatch.GetOwner());
                    }
                    jsonDataGridResult.total = ynPage.GetRecordCount();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
Beispiel #35
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                List <AscmWmsPreparationMain>   listAscmWmsPreparationMain   = null;
                List <AscmWmsPreparationDetail> listAscmWmsPreparationDetail = null;
                List <AscmWmsPreparationDetail> listDetail              = new List <AscmWmsPreparationDetail>();;
                AscmWmsPreparationMain          ascmWmsPreparationMain  = null;
                List <AscmWipDiscreteJobs>      listAscmWipDiscreteJobs = null;
                string wipSupplyType = "";
                string billNoStart = "", billNoEnd = "";
                string materialDocNumberStart = "", materialDocNumberEnd = "";
                string warehouseIdStart = "", warehouseIdEnd = "";
                string scheduledStartDateStart = "", scheduledStartDateEnd = "";
                string jobScheduleGroupsStart = "", jobScheduleGroupsEnd = "";
                string jobProductionLineStart = "", jobProductionLineEnd = "";
                if (!string.IsNullOrEmpty(Request.QueryString["docNumber"]))
                {
                    string docNumber = Request.QueryString["docNumber"];
                    if (!string.IsNullOrEmpty(docNumber))
                    {
                        listAscmWmsPreparationMain = AscmWmsPreparationMainService.GetInstance().GetList(" from AscmWmsPreparationMain where docNumber='" + docNumber + "'");
                        if (listAscmWmsPreparationMain != null && listAscmWmsPreparationMain.Count() > 0)
                        {
                            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                            ynPage.SetPageSize(500);  //pageRows;
                            ynPage.SetCurrentPage(1); //pageNumber;

                            ascmWmsPreparationMain = listAscmWmsPreparationMain[0];
                            //listAscmWmsPreparationDetail = AscmWmsPreparationDetailService.GetInstance().GetSumList(null,"", "", ascmWmsPreparationMain.id, "", "");
                            //listAscmWmsPreparationDetail = AscmWmsPreparationDetailService.GetInstance().GetList(ynPage,"","",ascmWmsPreparationMain.id,"","");
                            listAscmWmsPreparationDetail = AscmWmsPreparationDetailService.GetInstance().GetList(null, "", "", ascmWmsPreparationMain.id, "", "");
                            AscmWmsPreparationDetailService.GetInstance().SetWipDiscreteJobs(listAscmWmsPreparationDetail);
                            List <AscmWarelocation> listAscmWarelocation = AscmWarelocationService.GetInstance().GetList("from AscmWarelocation");
                            if (listAscmWmsPreparationDetail != null && listAscmWmsPreparationDetail.Count() > 0)
                            {
                                foreach (AscmWmsPreparationDetail ascmWmsPreparationDetail in listAscmWmsPreparationDetail)
                                {
                                    var find = listAscmWarelocation.Find(item => item.id == ascmWmsPreparationDetail.warelocationId);
                                    if (find != null)
                                    {
                                        ascmWmsPreparationDetail.locationDocNumber = find.docNumber;
                                    }
                                }
                                billNoStart            = listAscmWmsPreparationDetail.OrderBy(item => item.wipEntityName).First().wipEntityName;
                                billNoEnd              = listAscmWmsPreparationDetail.OrderBy(item => item.wipEntityName).Last().wipEntityName;
                                materialDocNumberStart = listAscmWmsPreparationDetail.OrderBy(item => item.materialDocNumber).First().materialDocNumber;
                                materialDocNumberEnd   = listAscmWmsPreparationDetail.OrderBy(item => item.materialDocNumber).Last().materialDocNumber;
                                warehouseIdStart       = listAscmWmsPreparationDetail.OrderBy(item => item.warehouseId).First().warehouseId;
                                warehouseIdEnd         = listAscmWmsPreparationDetail.OrderBy(item => item.warehouseId).Last().warehouseId;
                                //wipSupplyType = listAscmWmsPreparationDetail[0].ascmMaterialItem.wipSupplyTypeCn;
                                jobScheduleGroupsStart = listAscmWmsPreparationDetail.OrderBy(item => item.jobScheduleGroupsName).First().jobScheduleGroupsName;
                                jobScheduleGroupsEnd   = listAscmWmsPreparationDetail.OrderBy(item => item.jobScheduleGroupsName).Last().jobScheduleGroupsName;
                                jobProductionLineStart = listAscmWmsPreparationDetail.OrderBy(item => item.jobProductionLine).First().jobProductionLine;
                                jobProductionLineEnd   = listAscmWmsPreparationDetail.OrderBy(item => item.jobProductionLine).Last().jobProductionLine;
                                //string billIds = "";
                                var vbillIds = listAscmWmsPreparationDetail.Select(item => item.wipEntityId).Distinct();
                                if (vbillIds != null)
                                {
                                    string billIds = string.Empty;
                                    foreach (int billId in vbillIds)
                                    {
                                        if (!string.IsNullOrEmpty(billIds))
                                        {
                                            billIds += ",";
                                        }
                                        billIds += "'" + billId + "'";
                                    }
                                    if (!string.IsNullOrEmpty(billIds))
                                    {
                                        string whereOther = " id in (" + billIds + ")";
                                        listAscmWipDiscreteJobs = AscmWipDiscreteJobsService.GetInstance().GetList(null, "", "", "", whereOther);
                                        scheduledStartDateStart = listAscmWipDiscreteJobs.OrderBy(item => item._scheduledStartDate).First()._scheduledStartDate;
                                        scheduledStartDateEnd   = listAscmWipDiscreteJobs.OrderBy(item => item._scheduledStartDate).Last()._scheduledStartDate;
                                    }
                                }
                                #region 合计 同种物料在一个货位,进行数量合计,同种物料在不同货位,进行分开显示
                                var groupByMaterial = listAscmWmsPreparationDetail.GroupBy(p => p.materialId);
                                foreach (IGrouping <int, AscmWmsPreparationDetail> ig in groupByMaterial)
                                {
                                    //判断此物料的有多少条数据
                                    List <AscmWmsPreparationDetail> list = listAscmWmsPreparationDetail.Where(item => item.materialId == ig.Key).ToList();
                                    if (list != null && list.Count() > 1)
                                    {
                                        var groupByWarelocation = list.GroupBy(p => p.warelocationId);
                                        foreach (IGrouping <int, AscmWmsPreparationDetail> igrouping in groupByWarelocation)
                                        {
                                            AscmWmsPreparationDetail ascmWmsPreparationDetail_ByWarelocation = igrouping.First();
                                            AscmWmsPreparationDetail ascmWmsPreparationDetail = new AscmWmsPreparationDetail();
                                            ascmWmsPreparationDetail.materialId = igrouping.Key;
                                            //ascmWmsPreparationDetail.ascmMaterialItem = ascmWmsPreparationDetail_ByWarelocation.ascmMaterialItem;
                                            ascmWmsPreparationDetail.warehouseId       = ascmWmsPreparationDetail_ByWarelocation.warehouseId;
                                            ascmWmsPreparationDetail.locationDocNumber = ascmWmsPreparationDetail_ByWarelocation.locationDocNumber;
                                            ascmWmsPreparationDetail.wipSupplyType     = ascmWmsPreparationDetail_ByWarelocation.wipSupplyType;
                                            ascmWmsPreparationDetail.planQuantity      = igrouping.Sum(P => P.planQuantity);
                                            //ascmWmsPreparationDetail.quantity = igrouping.Sum(P => P.quantity);
                                            ascmWmsPreparationDetail.issueQuantity       = igrouping.Sum(P => P.issueQuantity);
                                            ascmWmsPreparationDetail.containerBindNumber = igrouping.Sum(P => P.containerBindNumber);
                                            listDetail.Add(ascmWmsPreparationDetail);
                                        }
                                    }
                                    else
                                    {
                                        AscmWmsPreparationDetail _ascmWmsPreparationDetail = ig.First();
                                        AscmWmsPreparationDetail ascmWmsPreparationDetail  = new AscmWmsPreparationDetail();
                                        ascmWmsPreparationDetail.materialId = ig.Key;
                                        //ascmWmsPreparationDetail.ascmMaterialItem = _ascmWmsPreparationDetail.ascmMaterialItem;
                                        ascmWmsPreparationDetail.warehouseId       = _ascmWmsPreparationDetail.warehouseId;
                                        ascmWmsPreparationDetail.locationDocNumber = _ascmWmsPreparationDetail.locationDocNumber;
                                        ascmWmsPreparationDetail.wipSupplyType     = _ascmWmsPreparationDetail.wipSupplyType;
                                        ascmWmsPreparationDetail.planQuantity      = ig.Sum(P => P.planQuantity);
                                        //ascmWmsPreparationDetail.quantity = ig.Sum(P => P.quantity);
                                        ascmWmsPreparationDetail.issueQuantity       = ig.Sum(P => P.issueQuantity);
                                        ascmWmsPreparationDetail.containerBindNumber = ig.Sum(P => P.containerBindNumber);
                                        listDetail.Add(ascmWmsPreparationDetail);
                                    }
                                }
                                #endregion
                            }
                            #region Code128
                            System.IO.MemoryStream    memoryStream = new System.IO.MemoryStream();
                            MideaAscm.Code.BarCode128 barCode128   = new Code.BarCode128();
                            barCode128.TitleFont   = new System.Drawing.Font("宋体", 10);
                            barCode128.HeightImage = 50;
                            System.Drawing.Bitmap bitmap = barCode128.GetCodeImage(docNumber, docNumber, Code.BarCode128.Encode.Code128B);
                            bitmap.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Gif);
                            if (listDetail != null && listDetail.Count() > 0)
                            {
                                listDetail = listDetail.OrderBy(item => item.materialDocNumber).ToList();
                                listDetail[0].barcodeShow = memoryStream.ToArray();
                            }
                            bitmap.Dispose();
                            #endregion

                            #region 条码 Code39
                            //System.IO.MemoryStream memoryStream = new System.IO.MemoryStream();
                            //YnBaseClass2.Helper.BarCode39 barCode39 = new YnBaseClass2.Helper.BarCode39();
                            //barCode39.WidthCU = 10;
                            //barCode39.WidthXI = 3;
                            //System.Drawing.Bitmap bitmap = barCode39.CreateBarCode(docNumber, docNumber, 0, 0);
                            //bitmap.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Gif);
                            //bitmap.Dispose();
                            //if (listDetail != null && listDetail.Count()>0)
                            //    listDetail[0].barcodeShow = memoryStream.ToArray();
                            #endregion
                        }
                    }
                }
                ReportViewer1.ProcessingMode         = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("WmsPreparationReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name  = "DataSet1";
                rds1.Value = listDetail;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                string title = "中央空调顺德工厂需求备料单";
                //string secondTitle = "车间任务物料需求报表";
                string userName = string.Empty;
                if (User.Identity.IsAuthenticated)
                {
                    userName = User.Identity.Name;
                }

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title", title),
                    //new ReportParameter("ReportParameter_secondTitle", secondTitle),
                    new ReportParameter("ReportParameter_ReportTime", "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")),
                    new ReportParameter("ReportParameter_wipSupplyType", "供应类型:" + wipSupplyType),
                    new ReportParameter("ReportParameter_scheduledStartDate", "计划时间从:" + scheduledStartDateStart + " 至 " + scheduledStartDateEnd),
                    new ReportParameter("ReportParameter_BillNo", "任务从:" + billNoStart + " 至 " + billNoEnd),
                    new ReportParameter("ReportParameter_materialDocNumber", "组件从:" + materialDocNumberStart + " 至 " + materialDocNumberEnd),
                    new ReportParameter("ReportParameter_warehouseId", "子库从:" + warehouseIdStart + " 至 " + warehouseIdEnd),
                    new ReportParameter("ReportParameter_jobScheduleGroups", "计划组从:" + jobScheduleGroupsStart + " 至 " + jobScheduleGroupsEnd),
                    new ReportParameter("ReportParameter_jobProductionLine", "生产线从:" + jobProductionLineStart + " 至 " + jobProductionLineEnd),
                    new ReportParameter("ReportParameter_Printer", "打印人:" + userName),
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
Beispiel #36
0
        public ActionResult ErpUserInfoList(int? page, int? rows, string sort, string order, string queryWord)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmUserInfo> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string organizationId = YnFrame.Web.FormsAuthenticationService.GetInstance().GetTicketOrganizationId();

                string where = " extExpandType='erp' and not exists (select 1 from Ascm_Ak_Web_User_Sec_Attr b where b.attributeCode='" + AscmAkWebUserSecAttrValues.AttributeCodeDefine.supplierUser + "' and b.webUserId=u.extExpandId) ";
                //where = " extExpandType='erp'";
                //where = " not exists (from AscmAkWebUserSecAttrValues b where b.id=a.extExpandId) ";
                //where = " not exists (from AscmAkWebUserSecAttrValues b where b.id=a.extExpandId) ";
                list = AscmUserInfoService.GetInstance().GetList( ynPage, sort, order, queryWord, where);
                foreach (AscmUserInfo ascmUserInfo in list)
                {
                    //ynUser.listYnDepartment = YnDepartmentService.GetInstance().GetListInUser(ynUser.userId);
                    //ynUser.listYnDepartmentPositionLink = YnDepartmentPositionLinkService.GetInstance().GetListInUser(ynUser.userId);
                    //ynUser.listYnRole = YnRoleService.GetInstance().GetListInUser(ynUser.userId);
                    jsonDataGridResult.rows.Add(ascmUserInfo.GetOwner());
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
Beispiel #37
0
        /// <summary>
        /// 任务分页查询 返回数量与单页数据
        /// </summary>
        /// <param name="count"></param>
        /// <returns></returns>
        private List<AscmGetMaterialTask> taskQuery(ref int count)
        {
            List<AscmGetMaterialTask> listTasks = null;
            string message = string.Empty;
            string _ynPage = string.Empty;

            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(pageControlTask.PageSize);
            ynPage.SetCurrentPage((pageControlTask.PageCurrent <= 0) ? 1 : pageControlTask.PageCurrent);
            _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage);
            //try
            //{
            string queryStatus = (cbxTaskStatus.SelectedItem == null) ? string.Empty : cbxTaskStatus.SelectedItem.ToString().Trim();
            if (!String.IsNullOrEmpty(queryStatus))
            {
                switch (queryStatus)
                {
                    case "已完成":
                        queryStatus = "FINISH";
                        break;
                    case "执行中":
                        queryStatus = "EXECUTE";
                        break;
                    case "已分配":
                        queryStatus = "NOTEXECUTE";
                        break;
                    case "未分配":
                        queryStatus = "NOTALLOCATE";
                        break;
                    default:
                        queryStatus = "";
                        break;
                }
            }
            string queryDate = taskCreateTime.Text.Trim();
            if (!String.IsNullOrEmpty(queryDate))
            {
                if (queryDate.LastIndexOf("星") > 0)
                {
                    queryDate = queryDate.Substring(0, queryDate.LastIndexOf("星"));
                }
                queryDate = DateTime.Parse(queryDate).ToString("yyyy-MM-dd");
            }
            WinForm.AscmWebService.AscmWebService service = new AscmWebService.AscmWebService();
            string jsonstr = service.GetTasksList(frmMain.encryptTicket, queryStatus, queryDate, ref _ynPage, ref message);
            if (!string.IsNullOrEmpty(jsonstr))
            {
                listTasks = (List<AscmGetMaterialTask>)JsonConvert.DeserializeObject(jsonstr, typeof(List<AscmGetMaterialTask>));
                if (listTasks != null && listTasks.Count > 0)
                {
                    ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage);
                    count = ynPage.GetRecordCount();
                }
                else
                {
                    MessageBoxEx.Show("没有查询到符合条件的领料任务!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            //}
            //catch (Exception ex)
            //{
            //    throw ex;
            //}
            return listTasks;
        }
Beispiel #38
0
        public ActionResult SupplierDeliveryNotifyMainList(int? page, int? rows, string sort, string order, string queryWord,
            string startReleasedTime, string endReleasedTime, string startNeedTime, string endNeedTime, string status, string employeeBuyer)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmDeliveryNotifyMain> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                YnFrame.Dal.Entities.YnUser ynUser = YnFrame.Web.FormsAuthenticationService.GetInstance().GetTicketUserData();
                if (ynUser == null)
                    throw new Exception("用户错误!");
                AscmUserInfo ascmUserInfo = AscmUserInfoService.GetInstance().Get(ynUser.userId);
                if (ascmUserInfo.extExpandType != "erp")
                    throw new Exception("供应商用户错误!");
                AscmUserInfoService.GetInstance().SetSupplier(ascmUserInfo);
                if (ascmUserInfo.ascmSupplier == null)
                    throw new Exception("供应商用户错误!");

                string whereOther = "", whereSupplier = "", whereStartReleaseTime = "", whereEndReleaseTime = "";
                string whereStartNeedTime = "", whereEndNeedTime = "", whereStatus = "", whereEmployeeBuyer = "";
                //if (!string.IsNullOrEmpty(supplier))
                whereSupplier = "supplierId=" + ascmUserInfo.ascmSupplier.id;
                if (!string.IsNullOrEmpty(status))
                {
                    whereStatus = "status = '" + status + "'";
                }
                else
                {
                    foreach (string s1 in MideaAscm.Dal.FromErp.Entities.AscmDeliveryNotifyMain.StatusDefine.GetSupplierList())
                    {
                        if (whereStatus != "")
                            whereStatus += ",";
                        whereStatus += "'" + s1 + "'";
                    }
                    if (whereStatus != "")
                        whereStatus = " status in (" + whereStatus + ")";
                }

                if (!string.IsNullOrEmpty(employeeBuyer))
                {
                    whereEmployeeBuyer = "materialId in (select id from AscmMaterialItem where buyerId=" + employeeBuyer + ")";
                }

                DateTime dtStartReleasedTime, dtEndReleasedTime;
                if (!string.IsNullOrEmpty(startReleasedTime) && DateTime.TryParse(startReleasedTime, out dtStartReleasedTime))
                    whereStartReleaseTime = "releasedTime>='" + dtStartReleasedTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(endReleasedTime) && DateTime.TryParse(endReleasedTime, out dtEndReleasedTime))
                    whereEndReleaseTime = "releasedTime<'" + dtEndReleasedTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";

                DateTime dtStartNeedTime, dtEndNeedTime;
                if (!string.IsNullOrEmpty(startNeedTime) && DateTime.TryParse(startNeedTime, out dtStartNeedTime))
                    whereStartNeedTime = "needTime>='" + dtStartNeedTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(endReleasedTime) && DateTime.TryParse(endNeedTime, out dtEndNeedTime))
                    whereEndNeedTime = "needTime<'" + dtEndNeedTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereSupplier);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartReleaseTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndReleaseTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartNeedTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndNeedTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStatus);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEmployeeBuyer);

                list = AscmDeliveryNotifyMainService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                foreach (AscmDeliveryNotifyMain ascmDeliveryNotifyMain in list)
                {
                    jsonDataGridResult.rows.Add(ascmDeliveryNotifyMain.GetOwner());
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                //throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
        private List<AscmMtlOnhandQuantitiesDetail> DataBindDataGridView(ref int count, int queryId)
        {
            List<AscmMtlOnhandQuantitiesDetail> list = null;
            string message = string.Empty;
            string _ynPage = string.Empty;

            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(pagerControlMaterial.PageSize);
            ynPage.SetCurrentPage((pagerControlMaterial.PageCurrent <= 0) ? 1 : pagerControlMaterial.PageCurrent);
            _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage);

            try
            {
                AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService();
                string jsonString = Service.GetMaterialWarehouseList(frmMainView.encryptTicket, materialId, ref _ynPage, ref message);
                if (!string.IsNullOrEmpty(jsonString))
                {
                    list = (List<AscmMtlOnhandQuantitiesDetail>)JsonConvert.DeserializeObject(jsonString, typeof(List<AscmMtlOnhandQuantitiesDetail>));
                    if (list != null && list.Count > 0)
                    {
                        ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage);
                        count = ynPage.GetRecordCount();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return list;
        }
Beispiel #40
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                string whereOther = "", whereDocNumber = "", whereSupplier = "", whereDirection = "";
                string whereStartCreateTime = "", whereEndCreateTime = "";

                if (Request.QueryString["docNumber"] != null && Request.QueryString["docNumber"].ToString().Trim() != "" && Request.QueryString["docNumber"].ToString().Trim() != "null")
                {
                    whereDocNumber = Request.QueryString["docNumber"].ToString();
                }
                if (Request.QueryString["supplierId"] != null && Request.QueryString["supplierId"].ToString().Trim() != "" && Request.QueryString["supplierId"].ToString().Trim() != "null")
                {
                    whereSupplier = "supplierId = '" + Request.QueryString["supplierId"].ToString() + "'";
                }
                if (Request.QueryString["direction"] != null && Request.QueryString["direction"].ToString().Trim() != "" && Request.QueryString["direction"].ToString().Trim() != "null")
                {
                    whereDirection = "direction = '" + Request.QueryString["direction"].ToString() + "'";
                }

                DateTime dtStartCreateTime, dtEndCreateTime;
                if (Request.QueryString["StartTime"] != null && Request.QueryString["StartTime"].ToString().Trim() != "" && Request.QueryString["StartTime"].ToString().Trim() != "null" && DateTime.TryParse(Request.QueryString["StartTime"].ToString().Trim(), out dtStartCreateTime))
                {
                    whereStartCreateTime = "createTime>='" + dtStartCreateTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                }
                if (Request.QueryString["EndTime"] != null && Request.QueryString["EndTime"].ToString().Trim() != "" && Request.QueryString["EndTime"].ToString().Trim() != "null" && DateTime.TryParse(Request.QueryString["EndTime"].ToString().Trim(), out dtEndCreateTime))
                {
                    whereEndCreateTime = "createTime<'" + dtEndCreateTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";
                }

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereDocNumber);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereSupplier);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereDirection);
                //whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereMaterialItem);

                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500);  //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List <AscmStoreInOut> listAscmStoreInOut = AscmStoreInOutService.GetInstance().GetReportList(whereDocNumber);
                //var  res=listAscmStoreInOut.GroupBy(x=>new(x.docNumber,x.ascmContainer.specId,x.supplierId));
                ReportViewer1.ProcessingMode         = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("ContainerHistoryReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name  = "DataSet1";
                rds1.Value = listAscmStoreInOut;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                //string companpyTitle = YnParameterService.GetInstance().GetValue(MyParameter.companpyTitle);
                string companpyTitle = "美的中央空调";
                string title         = companpyTitle + "容器出入库报表打印";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title", title),
                    new ReportParameter("ReportParameter_ReportTime", "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd"))
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
                //ReportViewer1.LocalReport.Refresh();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                string queryWord = "";
                string whereOther = "", whereSupplier = "", whereWarehouse = "";
                string whereStartCreateTime = "", whereEndCreateTime = "", whereStatus = "";

                YnFrame.Dal.Entities.YnUser ynUser = YnFrame.Web.FormsAuthenticationService.GetInstance().GetTicketUserData();
                if (ynUser == null)
                    throw new Exception("用户错误!");
                AscmUserInfo ascmUserInfo = AscmUserInfoService.GetInstance().Get(ynUser.userId);
                if (ascmUserInfo.extExpandType != "erp")
                    throw new Exception("供应商用户错误!");
                AscmUserInfoService.GetInstance().SetSupplier(ascmUserInfo);
                if (ascmUserInfo.ascmSupplier == null)
                    throw new Exception("供应商用户错误!");

                whereSupplier = "supplierId = '" + ascmUserInfo.ascmSupplier.id + "'";
                if (Request.QueryString["warehouse"] != null && Request.QueryString["warehouse"].ToString().Trim() != "" && Request.QueryString["warehouse"].ToString().Trim() != "null")
                    whereWarehouse = "warehouseId = '" + Request.QueryString["warehouse"].ToString() + "'";
                if (Request.QueryString["status"] != null && Request.QueryString["status"].ToString().Trim() != "" && Request.QueryString["status"].ToString().Trim() != "null")
                    whereStatus = "status = '" + Request.QueryString["status"].ToString() + "'";

                DateTime dtStartCreateTime, dtEndCreateTime;
                if (Request.QueryString["startCreateTime"] != null && Request.QueryString["startCreateTime"].ToString().Trim() != "" && Request.QueryString["startCreateTime"].ToString().Trim() != "null" && DateTime.TryParse(Request.QueryString["startCreateTime"].ToString().Trim(), out dtStartCreateTime))
                    whereStartCreateTime = "createTime>='" + dtStartCreateTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (Request.QueryString["endCreateTime"] != null && Request.QueryString["endCreateTime"].ToString().Trim() != "" && Request.QueryString["endCreateTime"].ToString().Trim() != "null" && DateTime.TryParse(Request.QueryString["endCreateTime"].ToString().Trim(), out dtEndCreateTime))
                    whereEndCreateTime = "createTime<'" + dtEndCreateTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereSupplier);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereWarehouse);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStatus);
                //whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereMaterialItem);

                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500); //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List<AscmDeliveryOrderBatch> listAscmDeliveryOrderBatch = AscmDeliveryOrderBatchService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("SupplierDeliveryOrderBatchReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name = "DataSet1";
                rds1.Value = listAscmDeliveryOrderBatch;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                //string companpyTitle = YnParameterService.GetInstance().GetValue(MyParameter.companpyTitle);
                string companpyTitle = "美的中央空调";
                string title = companpyTitle + "批送货单统计报表";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title",title ),
                    new ReportParameter("ReportParameter_ReportTime","打印时间:"+DateTime.Now.ToString("yyyy-MM-dd") ),
                    new ReportParameter("ReportParameter_SupplierName","供应商:"+ascmUserInfo.ascmSupplier.name )
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
                //ReportViewer1.LocalReport.Refresh();
            }
        }
Beispiel #42
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                YnFrame.Dal.Entities.YnUser ynUser = YnFrame.Web.FormsAuthenticationService.GetInstance().GetTicketUserData();
                if (ynUser == null)
                {
                    throw new Exception("用户错误!");
                }
                AscmUserInfo ascmUserInfo = AscmUserInfoService.GetInstance().Get(ynUser.userId);
                if (ascmUserInfo.extExpandType != "erp")
                {
                    throw new Exception("供应商用户错误!");
                }
                AscmUserInfoService.GetInstance().SetSupplier(ascmUserInfo);
                if (ascmUserInfo.ascmSupplier == null)
                {
                    throw new Exception("供应商用户错误!");
                }

                //提取数据
                List <AscmDeliBatSumDetail> list = new List <AscmDeliBatSumDetail>();
                string ids = Request.QueryString["ids"];
                if (!string.IsNullOrEmpty(ids))
                {
                    YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                    ynPage.SetPageSize(500);  //pageRows;
                    ynPage.SetCurrentPage(1); //pageNumber;

                    list = AscmDeliBatSumDetailService.GetInstance().GetList("from AscmDeliBatSumDetail where id in(" + ids + ")");

                    AscmDeliBatSumDetailService.GetInstance().SetMaterial(list);
                    AscmDeliBatSumDetailService.GetInstance().SetDeliveryOrderBatch(list);
                    List <AscmDeliveryOrderBatch> listDeliveryOrderBatch = new List <AscmDeliveryOrderBatch>();
                    list.ForEach(P => listDeliveryOrderBatch.Add(
                                     new AscmDeliveryOrderBatch
                    {
                        id = P.batchId
                    }));
                    //获取货位分配
                    AscmDeliveryOrderBatchService.GetInstance().SetAssignWarelocation(listDeliveryOrderBatch);
                    list.ForEach(P => P.assignWarelocation = listDeliveryOrderBatch.Find(T => T.id == P.batchId).assignWarelocation);
                    //条码
                    foreach (AscmDeliBatSumDetail ascmDeliBatSumDetail in list)
                    {
                        System.IO.MemoryStream memoryStream = new System.IO.MemoryStream();
                        if (ascmDeliBatSumDetail.ascmMaterialItem != null && ascmDeliBatSumDetail.ascmMaterialItem.docNumber != null)
                        {
                            #region Code128
                            MideaAscm.Code.BarCode128 barCode128 = new Code.BarCode128();
                            barCode128.TitleFont   = new Font("宋体", 10);
                            barCode128.HeightImage = 50;
                            Bitmap bitmap = barCode128.GetCodeImage(ascmDeliBatSumDetail.ascmMaterialItem.docNumber, ascmDeliBatSumDetail.ascmMaterialItem.docNumber, Code.BarCode128.Encode.Code128B);
                            bitmap.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Gif);
                            bitmap.Dispose();
                            #endregion

                            #region Code39
                            //YnBaseClass2.Helper.BarCode39 barCode39 = new YnBaseClass2.Helper.BarCode39();
                            //barCode39.WidthCU = 10;
                            //barCode39.WidthXI = 3;
                            //System.Drawing.Bitmap bitmap = barCode39.CreateBarCode(ascmDeliBatSumDetail.ascmMaterialItem.docNumber, ascmDeliBatSumDetail.ascmMaterialItem.docNumber, 0, 0);
                            ////生成图片
                            ////System.IO.MemoryStream memoryStream = new System.IO.MemoryStream();
                            //bitmap.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Gif);
                            //bitmap.Dispose();
                            #endregion
                        }
                        ascmDeliBatSumDetail.materialBarcode = memoryStream.ToArray();
                    }
                }
                ReportViewer1.ProcessingMode         = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("SupplierDriverDeliveryBarCodeReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name  = "DataSet1";
                rds1.Value = list;
                ReportViewer1.LocalReport.DataSources.Clear();
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                string companpyTitle = "美的中央空调";
                string title         = companpyTitle + "供应商送货合单条码";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_SupplierName", ascmUserInfo.ascmSupplier.name)
                };

                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
Beispiel #43
0
        public ActionResult EmployeeAscxList(int? id,int? page, int? rows, string sort, string order, string q)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmEmployee> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = "";
                if (string.IsNullOrEmpty(q))
                {
                    if (id.HasValue)
                    {
                        whereOther = "id=" + id.Value;
                    }
                }
                list = AscmEmployeeService.GetInstance().GetList(ynPage, "", "", q,whereOther);
                foreach (AscmEmployee ascmEmployee in list)
                {
                    jsonDataGridResult.rows.Add(ascmEmployee.GetOwner());
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
Beispiel #44
0
        public ActionResult MaterialMonitorList(int? page, int? rows, string sort, string order, string queryWord,
            int? supplierId, string warehouse, string startCreateTime, string endCreateTime, string status, int? employeeBuyer)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmDeliveryOrderBatch> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = "", whereSupplier = "", whereWarehouse = "", whereEmployeeBuyer = "";
                string whereStartCreateTime = "", whereEndCreateTime = "", whereStatus = "";

                if (supplierId.HasValue)
                    whereSupplier = "supplierId=" + supplierId.Value;
                if (!string.IsNullOrEmpty(warehouse))
                    whereWarehouse = "warehouseId = '" + warehouse + "'";
                //if (!string.IsNullOrEmpty(status))
                whereStatus = "status = '" + MideaAscm.Dal.FromErp.Entities.AscmDeliveryOrderMain.StatusDefine.open + "'";

                DateTime dtStartCreateTime, dtEndCreateTime;
                if (!string.IsNullOrEmpty(startCreateTime) && DateTime.TryParse(startCreateTime, out dtStartCreateTime))
                    whereStartCreateTime = "createTime>='" + dtStartCreateTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(endCreateTime) && DateTime.TryParse(endCreateTime, out dtEndCreateTime))
                    whereEndCreateTime = "createTime<'" + dtEndCreateTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";

                if (employeeBuyer.HasValue)
                    whereEmployeeBuyer = "id in(select batchId from AscmDeliveryOrderMain where id in(select mainId from AscmDeliveryOrderDetail where materialId in(select id from AscmMaterialItem where buyerId=" + employeeBuyer + ")))";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereSupplier);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereWarehouse);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStatus);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEmployeeBuyer);

                list = AscmDeliveryOrderBatchService.GetInstance().GetMonitorList(ynPage, "", "", queryWord, whereOther);
                if (list != null)
                {
                    foreach (AscmDeliveryOrderBatch ascmDeliveryOrderBatch in list)
                    {
                        jsonDataGridResult.rows.Add(ascmDeliveryOrderBatch.GetOwner());
                    }
                    jsonDataGridResult.total = ynPage.GetRecordCount();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
        private List <AscmWipDiscreteJobs> DataBindAdvTreeFristLevelNode(ref int count, string taskString)
        {
            List <AscmWipDiscreteJobs> list = null;
            string message = string.Empty;
            string _ynPage = string.Empty;

            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(pageControlTask.PageSize);
            ynPage.SetCurrentPage((pageControlTask.PageCurrent <= 0) ? 1 : pageControlTask.PageCurrent);
            _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage);

            try
            {
                string queryType = string.Empty;
                if (cbItemTaskType.SelectedItem != null)
                {
                    switch (cbItemTaskType.SelectedItem.ToString())
                    {
                    case "总装":
                        queryType = "1";
                        break;

                    case "电装":
                        queryType = "2";
                        break;

                    default:
                        queryType = "";
                        break;
                    }
                }

                string queryFormat = string.Empty;
                if (cbItemMtlCategoryStatus.SelectedItem != null)
                {
                    switch (cbItemMtlCategoryStatus.SelectedItem.ToString())
                    {
                    case "有库存":
                        queryFormat = "INSTOCK";
                        break;

                    case "须备料":
                        queryFormat = "PRESTOCK";
                        break;

                    case "须配料":
                        queryFormat = "MIXSTOCK";
                        break;

                    case "特殊子库":
                        queryFormat = "SPECWAREHOUSE";
                        break;

                    case "临时任务":
                        queryFormat = "TEMPTASK";
                        break;

                    default:
                        queryFormat = "";
                        break;
                    }
                }

                string queryStatus = string.Empty;
                if (cbItemTaskStatus.SelectedItem != null)
                {
                    switch (cbItemTaskStatus.SelectedItem.ToString())
                    {
                    case "已分配":
                        queryStatus = "NOTEXECUTE";
                        break;

                    case "执行中":
                        queryStatus = "EXECUTE";
                        break;

                    case "已完成":
                        queryStatus = "FINISH";
                        break;

                    case "已关闭":
                        queryStatus = "CLOSE";
                        break;

                    default:
                        queryStatus = "";
                        break;
                    }
                }

                string queryLine      = (tbItemProductLine.Text == "") ? string.Empty : tbItemProductLine.Text.ToUpper().ToString();
                string queryTime      = (cbItemTaskTime.SelectedItem == null) ? string.Empty : cbItemTaskTime.SelectedItem.ToString();
                string queryWarehouse = (tbItemWarehouse.Text == "") ? string.Empty : tbItemWarehouse.Text.ToUpper().ToString();

                AscmWebService.AscmWebService service = new AscmWebService.AscmWebService();
                string jsonString = service.GetMonitorTaskList(frmMainView.encryptTicket, frmMainView.userName, tbItemStart.Text, tbItemEnd.Text, tbItemJobStart.Text, tbItemJobEnd.Text, queryType, queryFormat, queryStatus, queryLine, queryTime, queryWarehouse, tbItemWipEntity.Text, taskString, ref _ynPage, ref message);
                if (!string.IsNullOrEmpty(jsonString))
                {
                    list = (List <AscmWipDiscreteJobs>)JsonConvert.DeserializeObject(jsonString, typeof(List <AscmWipDiscreteJobs>));
                    if (list != null && list.Count > 0)
                    {
                        ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage);
                        count  = ynPage.GetRecordCount();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(list);
        }
Beispiel #46
0
        public ActionResult SupplierAscxList(int? id, int? page, int? rows, string sort, string order, string q)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmSupplier> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                list = AscmSupplierService.GetInstance().GetList(ynPage, "", "", q,null);
                foreach (AscmSupplier ascmSupplier in list)
                {
                    jsonDataGridResult.rows.Add(ascmSupplier.GetOwner());
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                string queryWord = "";
                string whereOther = "", whereMain = "";
                string whereSupplier = "", whereWarehouse = "", whereMaterialItem = "";
                string whereStartDeliveryTime = "", whereEndDeliveryTime = "", whereStatus = "", whereWipEntity = "";

                YnFrame.Dal.Entities.YnUser ynUser = YnFrame.Web.FormsAuthenticationService.GetInstance().GetTicketUserData();
                if (ynUser == null)
                {
                    throw new Exception("用户错误!");
                }
                AscmUserInfo ascmUserInfo = AscmUserInfoService.GetInstance().Get(ynUser.userId);
                if (ascmUserInfo.extExpandType != "erp")
                {
                    throw new Exception("供应商用户错误!");
                }
                AscmUserInfoService.GetInstance().SetSupplier(ascmUserInfo);
                if (ascmUserInfo.ascmSupplier == null)
                {
                    throw new Exception("供应商用户错误!");
                }

                if (Request.QueryString["queryWord"] != null && Request.QueryString["queryWord"].ToString().Trim() != "" && Request.QueryString["queryWord"].ToString().Trim() != "null")
                {
                    queryWord = Request.QueryString["queryWord"].ToString();
                }

                if (Request.QueryString["materialItem"] != null && Request.QueryString["materialItem"].ToString().Trim() != "" && Request.QueryString["materialItem"].ToString().Trim() != "null")
                {
                    whereMaterialItem = "materialId = " + Request.QueryString["materialItem"].ToString();
                }
                whereSupplier = "supplierId = " + ascmUserInfo.ascmSupplier.id + "";
                if (Request.QueryString["warehouse"] != null && Request.QueryString["warehouse"].ToString().Trim() != "" && Request.QueryString["warehouse"].ToString().Trim() != "null")
                {
                    whereWarehouse = "warehouseId = '" + Request.QueryString["warehouse"].ToString() + "'";
                }
                if (Request.QueryString["status"] != null && Request.QueryString["status"].ToString().Trim() != "" && Request.QueryString["status"].ToString().Trim() != "null")
                {
                    whereStatus = "status = '" + Request.QueryString["status"].ToString() + "'";
                }

                DateTime dtStartDeliveryTime, dtEndDeliveryTime;
                if (Request.QueryString["startDeliveryTime"] != null && Request.QueryString["startDeliveryTime"].ToString().Trim() != "" && Request.QueryString["startDeliveryTime"].ToString().Trim() != "null" && DateTime.TryParse(Request.QueryString["startDeliveryTime"].ToString().Trim(), out dtStartDeliveryTime))
                {
                    whereStartDeliveryTime = "deliveryTime>='" + dtStartDeliveryTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                }
                if (Request.QueryString["endCreateTime"] != null && Request.QueryString["endCreateTime"].ToString().Trim() != "" && Request.QueryString["endCreateTime"].ToString().Trim() != "null" && DateTime.TryParse(Request.QueryString["endCreateTime"].ToString().Trim(), out dtEndDeliveryTime))
                {
                    whereEndDeliveryTime = "deliveryTime<'" + dtEndDeliveryTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";
                }

                if (Request.QueryString["wipEntityId"] != null && Request.QueryString["wipEntityId"].ToString().Trim() != "" && Request.QueryString["wipEntityId"].ToString().Trim() != "null")
                {
                    whereStatus = "wipEntityId = " + Request.QueryString["wipEntityId"];
                }

                whereMain  = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereMain, whereSupplier);
                whereMain  = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereMain, whereWarehouse);
                whereMain  = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereMain, whereStatus);
                whereMain  = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereMain, whereStartDeliveryTime);
                whereMain  = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereMain, whereEndDeliveryTime);
                whereMain  = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereMain, whereWipEntity);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereMaterialItem);

                if (!string.IsNullOrEmpty(whereMain))
                {
                    whereMain = "mainId in (select id from AscmDeliveryOrderMain where " + whereMain + ")";
                }

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereMain);

                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500);  //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List <AscmDeliveryOrderDetail> listAscmDeliveryOrderDetail = AscmDeliveryOrderDetailService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                ReportViewer1.ProcessingMode         = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("SupplierDeliveryOrderDetailReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name  = "DataSet1";
                rds1.Value = listAscmDeliveryOrderDetail;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                //string companpyTitle = YnParameterService.GetInstance().GetValue(MyParameter.companpyTitle);
                string companpyTitle = "美的中央空调";
                string title         = companpyTitle + "送货单明细统计报表";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title", title),
                    new ReportParameter("ReportParameter_ReportTime", "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd")),
                    new ReportParameter("ReportParameter_SupplierName", "供应商:" + ascmUserInfo.ascmSupplier.name)
                };

                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
Beispiel #48
0
        private List <AscmGetMaterialTask> GetTaskTree(ref int count)
        {
            List <AscmGetMaterialTask> listTasks = null;
            string message = string.Empty;
            string _ynPage = string.Empty;

            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(pageControlTask.PageSize);
            ynPage.SetCurrentPage((pageControlTask.PageCurrent <= 0) ? 1 : pageControlTask.PageCurrent);
            _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage);

            try
            {
                string status = (tscbTaskStatus.SelectedItem == null) ? string.Empty : tscbTaskStatus.SelectedItem.ToString().Trim();
                if (!string.IsNullOrEmpty(status))
                {
                    switch (status)
                    {
                    case "已完成":
                        status = "FINISH";
                        break;

                    case "执行中":
                        status = "EXECUTE";
                        break;

                    case "已分配":
                        status = "NOTEXECUTE";
                        break;

                    case "未分配":
                        status = "NOTALLOCATE";
                        break;

                    default:
                        status = "";
                        break;
                    }
                }
                WinForm.AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService();
                string jsonStr = Service.GetTaskList(frmMain.encryptTicket, frmMain.userName, status, ref _ynPage, ref message);
                if (!string.IsNullOrEmpty(jsonStr))
                {
                    listTasks = (List <AscmGetMaterialTask>)JsonConvert.DeserializeObject(jsonStr, typeof(List <AscmGetMaterialTask>));
                    if (listTasks != null && listTasks.Count > 0)
                    {
                        ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage);
                        count  = ynPage.GetRecordCount();
                    }
                    else
                    {
                        MessageBoxEx.Show("没有查询到符合条件的领料任务!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(listTasks);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                YnFrame.Dal.Entities.YnUser ynUser = YnFrame.Web.FormsAuthenticationService.GetInstance().GetTicketUserData();
                if (ynUser == null)
                    throw new Exception("用户错误!");
                AscmUserInfo ascmUserInfo = AscmUserInfoService.GetInstance().Get(ynUser.userId);
                if (ascmUserInfo.extExpandType != "erp")
                    throw new Exception("供应商用户错误!");
                AscmUserInfoService.GetInstance().SetSupplier(ascmUserInfo);
                if (ascmUserInfo.ascmSupplier == null)
                    throw new Exception("供应商用户错误!");

                //提取数据
                List<AscmDeliBatSumDetail> list = new List<AscmDeliBatSumDetail>();
                string ids = Request.QueryString["ids"];
                if (!string.IsNullOrEmpty(ids))
                {
                    YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                    ynPage.SetPageSize(500); //pageRows;
                    ynPage.SetCurrentPage(1); //pageNumber;

                    list = AscmDeliBatSumDetailService.GetInstance().GetList("from AscmDeliBatSumDetail where id in(" + ids + ")");

                    AscmDeliBatSumDetailService.GetInstance().SetMaterial(list);
                    AscmDeliBatSumDetailService.GetInstance().SetDeliveryOrderBatch(list);
                    List<AscmDeliveryOrderBatch> listDeliveryOrderBatch = new List<AscmDeliveryOrderBatch>();
                    list.ForEach(P => listDeliveryOrderBatch.Add(
                        new AscmDeliveryOrderBatch
                        {
                            id = P.batchId
                        }));
                    //获取货位分配
                    AscmDeliveryOrderBatchService.GetInstance().SetAssignWarelocation(listDeliveryOrderBatch);
                    list.ForEach(P => P.assignWarelocation = listDeliveryOrderBatch.Find(T => T.id == P.batchId).assignWarelocation);
                    //条码
                    foreach (AscmDeliBatSumDetail ascmDeliBatSumDetail in list)
                    {
                        System.IO.MemoryStream memoryStream = new System.IO.MemoryStream();
                        if (ascmDeliBatSumDetail.ascmMaterialItem!=null&&ascmDeliBatSumDetail.ascmMaterialItem.docNumber != null)
                        {
                            #region Code128
                            MideaAscm.Code.BarCode128 barCode128 = new Code.BarCode128();
                            barCode128.TitleFont = new Font("宋体", 10);
                            barCode128.HeightImage = 50;
                            Bitmap bitmap = barCode128.GetCodeImage(ascmDeliBatSumDetail.ascmMaterialItem.docNumber, ascmDeliBatSumDetail.ascmMaterialItem.docNumber, Code.BarCode128.Encode.Code128B);
                            bitmap.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Gif);
                            bitmap.Dispose();
                            #endregion

                            #region Code39
                            //YnBaseClass2.Helper.BarCode39 barCode39 = new YnBaseClass2.Helper.BarCode39();
                            //barCode39.WidthCU = 10;
                            //barCode39.WidthXI = 3;
                            //System.Drawing.Bitmap bitmap = barCode39.CreateBarCode(ascmDeliBatSumDetail.ascmMaterialItem.docNumber, ascmDeliBatSumDetail.ascmMaterialItem.docNumber, 0, 0);
                            ////生成图片
                            ////System.IO.MemoryStream memoryStream = new System.IO.MemoryStream();
                            //bitmap.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Gif);
                            //bitmap.Dispose();
                            #endregion
                        }
                        ascmDeliBatSumDetail.materialBarcode = memoryStream.ToArray();

                    }
                }
                ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("SupplierDriverDeliveryBarCodeReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name = "DataSet1";
                rds1.Value = list;
                ReportViewer1.LocalReport.DataSources.Clear();
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                string companpyTitle = "美的中央空调";
                string title = companpyTitle + "供应商送货合单条码";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_SupplierName",ascmUserInfo.ascmSupplier.name )
                };

                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
            }
        }
Beispiel #50
0
        /// <summary>
        /// 任务分页查询 返回数量与单页数据
        /// </summary>
        /// <param name="count"></param>
        /// <returns></returns>
        private List <AscmGetMaterialTask> taskQuery(ref int count)
        {
            List <AscmGetMaterialTask> listTasks = null;
            string message = string.Empty;
            string _ynPage = string.Empty;

            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(pageControlTask.PageSize);
            ynPage.SetCurrentPage((pageControlTask.PageCurrent <= 0) ? 1 : pageControlTask.PageCurrent);
            _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage);
            //try
            //{
            string queryStatus = (cbxTaskStatus.SelectedItem == null) ? string.Empty : cbxTaskStatus.SelectedItem.ToString().Trim();

            if (!String.IsNullOrEmpty(queryStatus))
            {
                switch (queryStatus)
                {
                case "已完成":
                    queryStatus = "FINISH";
                    break;

                case "执行中":
                    queryStatus = "EXECUTE";
                    break;

                case "已分配":
                    queryStatus = "NOTEXECUTE";
                    break;

                case "未分配":
                    queryStatus = "NOTALLOCATE";
                    break;

                default:
                    queryStatus = "";
                    break;
                }
            }
            string queryDate = taskCreateTime.Text.Trim();

            if (!String.IsNullOrEmpty(queryDate))
            {
                if (queryDate.LastIndexOf("星") > 0)
                {
                    queryDate = queryDate.Substring(0, queryDate.LastIndexOf("星"));
                }
                queryDate = DateTime.Parse(queryDate).ToString("yyyy-MM-dd");
            }
            WinForm.AscmWebService.AscmWebService service = new AscmWebService.AscmWebService();
            string jsonstr = service.GetTasksList(frmMain.encryptTicket, queryStatus, queryDate, ref _ynPage, ref message);

            if (!string.IsNullOrEmpty(jsonstr))
            {
                listTasks = (List <AscmGetMaterialTask>)JsonConvert.DeserializeObject(jsonstr, typeof(List <AscmGetMaterialTask>));
                if (listTasks != null && listTasks.Count > 0)
                {
                    ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage);
                    count  = ynPage.GetRecordCount();
                }
                else
                {
                    MessageBoxEx.Show("没有查询到符合条件的领料任务!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            //}
            //catch (Exception ex)
            //{
            //    throw ex;
            //}
            return(listTasks);
        }
Beispiel #51
0
        public ActionResult LoadJobLog(int? page, int? rows, string sort, string order, string jobName, string queryWord)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmJobLog> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                if (jobName != null && jobName.Trim() != "")
                {
                    list = AscmJobLogService.GetInstance().GetList(ynPage, sort, order, jobName, queryWord);
                    if (list != null)
                    {
                        foreach (AscmJobLog ascmJobLog in list)
                        {
                            jsonDataGridResult.rows.Add(ascmJobLog);
                        }
                        jsonDataGridResult.total = ynPage.GetRecordCount();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
Beispiel #52
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //提取数据
                string queryWord = "";
                string whereOther = "", whereSupplier = "", whereWarehouse = "", whereMaterialItem = "", whereStartReleaseTime = "", whereEndReleaseTime = "";
                string whereStartCreateTime = "", whereEndCreateTime = "", whereStatus = "", whereEmployeeBuyer = "";

                if (Request.QueryString["supplier"] != null && Request.QueryString["supplier"].ToString().Trim() != "" && Request.QueryString["supplier"].ToString().Trim() != "null")
                {
                    whereSupplier = "a.supplierId = " + Request.QueryString["supplier"].ToString() + "";
                }
                if (Request.QueryString["materialItem"] != null && Request.QueryString["materialItem"].ToString().Trim() != "" && Request.QueryString["materialItem"].ToString().Trim() != "null")
                {
                    whereMaterialItem = "a.materialId = " + Request.QueryString["materialItem"].ToString() + "";
                }
                if (Request.QueryString["warehouse"] != null && Request.QueryString["warehouse"].ToString().Trim() != "" && Request.QueryString["warehouse"].ToString().Trim() != "null")
                {
                    whereWarehouse = "a.warehouseId = '" + Request.QueryString["warehouse"].ToString() + "'";
                }
                if (Request.QueryString["status"] != null && Request.QueryString["status"].ToString().Trim() != "" && Request.QueryString["status"].ToString().Trim() != "null")
                {
                    whereStatus = "a.status = '" + Request.QueryString["status"].ToString() + "'";
                }
                if (Request.QueryString["employeeBuyer"] != null && Request.QueryString["employeeBuyer"].ToString().Trim() != "" && Request.QueryString["employeeBuyer"].ToString().Trim() != "null")
                {
                    whereEmployeeBuyer = "a.materialId in (select id from AscmMaterialItem where buyerId=" + Request.QueryString["employeeBuyer"].ToString().Trim() + ")";
                }

                if (Request.QueryString["queryWord"] != null && Request.QueryString["queryWord"].ToString().Trim() != "" && Request.QueryString["queryWord"].ToString().Trim() != "null")
                {
                    queryWord = Request.QueryString["queryWord"].ToString();
                }

                DateTime dtStartReleasedTime, dtEndReleasedTime;
                if (Request.QueryString["startReleasedTime"] != null && Request.QueryString["startReleasedTime"].ToString().Trim() != "" && Request.QueryString["startReleasedTime"].ToString().Trim() != "null" && DateTime.TryParse(Request.QueryString["startReleasedTime"].ToString().Trim(), out dtStartReleasedTime))
                {
                    whereStartReleaseTime = "a.releasedTime>='" + dtStartReleasedTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                }
                if (Request.QueryString["endReleasedTime"] != null && Request.QueryString["endReleasedTime"].ToString().Trim() != "" && Request.QueryString["endReleasedTime"].ToString().Trim() != "null" && DateTime.TryParse(Request.QueryString["endReleasedTime"].ToString().Trim(), out dtEndReleasedTime))
                {
                    whereEndReleaseTime = "a.releasedTime<'" + dtEndReleasedTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";
                }

                DateTime dtStartCreateTime, dtEndCreateTime;
                if (Request.QueryString["startCreateTime"] != null && Request.QueryString["startCreateTime"].ToString().Trim() != "" && Request.QueryString["startCreateTime"].ToString().Trim() != "null" && DateTime.TryParse(Request.QueryString["startCreateTime"].ToString().Trim(), out dtStartCreateTime))
                {
                    whereStartCreateTime = "a.createTime>='" + dtStartCreateTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                }
                if (Request.QueryString["endCreateTime"] != null && Request.QueryString["endCreateTime"].ToString().Trim() != "" && Request.QueryString["endCreateTime"].ToString().Trim() != "null" && DateTime.TryParse(Request.QueryString["endCreateTime"].ToString().Trim(), out dtEndCreateTime))
                {
                    whereEndCreateTime = "a.createTime<'" + dtEndCreateTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";
                }

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereSupplier);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereMaterialItem);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereWarehouse);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartReleaseTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndReleaseTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStatus);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEmployeeBuyer);

                YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
                ynPage.SetPageSize(500);  //pageRows;
                ynPage.SetCurrentPage(1); //pageNumber;

                List <AscmDeliveryNotifyMain> listAscmDeliveryNotifyMain = AscmDeliveryNotifyMainService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                ReportViewer1.ProcessingMode         = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("DeliveryNotifyReport.rdlc");
                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name  = "DataSet1";
                rds1.Value = listAscmDeliveryNotifyMain;
                ReportViewer1.LocalReport.DataSources.Clear();//好像不clear也可以
                ReportViewer1.LocalReport.DataSources.Add(rds1);

                //string companpyTitle = YnParameterService.GetInstance().GetValue(MyParameter.companpyTitle);
                string companpyTitle = "美的中央空调";
                string title         = companpyTitle + "送货通知单统计报表";

                ReportParameter[] reportParameters = new ReportParameter[] {
                    new ReportParameter("ReportParameter_Title", title),
                    new ReportParameter("ReportParameter_ReportTime", "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd"))
                };
                ReportViewer1.LocalReport.SetParameters(reportParameters);
                ReportViewer1.LocalReport.Refresh();
                //ReportViewer1.LocalReport.Refresh();
            }
        }
Beispiel #53
0
        public ActionResult SupplierMaterialList(int? page, int? rows, string sort, string order, int? supplierId, string queryWord, string startInventoryItemId, string endInventoryItemId)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                if (supplierId.HasValue)
                {
                    List<AscmSupplierMaterialLink> listAscmSupplierMaterialLink = AscmSupplierMaterialLinkService.GetInstance().GetList(supplierId.Value);
                    List<AscmMaterialItem> listAscmMaterialItem = null;
                    if (listAscmSupplierMaterialLink != null && listAscmSupplierMaterialLink.Count() > 0)
                    {
                        string materialIds = string.Empty;
                        foreach (AscmSupplierMaterialLink ascmSupplierMaterialLink in listAscmSupplierMaterialLink)
                        {
                            if (!string.IsNullOrEmpty(materialIds))
                                materialIds += ",";
                            materialIds += ascmSupplierMaterialLink.materialId;
                        }
                        if (!string.IsNullOrEmpty(materialIds))
                        {
                            string[] Ids = materialIds.Split(',');
                            int iCount = Ids.Length;
                            string sWhere = string.Empty;
                            if (iCount > 900)
                            {
                                string ids = string.Empty;
                                for (int i = 0; i < iCount; i++)
                                {
                                    if (!string.IsNullOrEmpty(ids))
                                        ids += ",";
                                    ids += Ids.ElementAt(i);
                                    if ((i + 1) % 900 == 0 || (i + 1) == iCount)
                                    {
                                        if (!string.IsNullOrEmpty(sWhere))
                                            sWhere += " or ";
                                        sWhere += "id in (" + ids + ")";
                                        ids = string.Empty;
                                    }
                                }
                            }
                            else
                                sWhere = "id in (" + materialIds + ")";

                            string whereStartInventoryItemId = string.Empty, whereEndInventoryItemId = string.Empty, sWhereId = string.Empty;
                            if (!string.IsNullOrEmpty(startInventoryItemId))
                            {
                                whereStartInventoryItemId = " docNumber='" + startInventoryItemId.Trim() + "'";
                            }
                            if (!string.IsNullOrEmpty(endInventoryItemId))
                            {
                                if (!string.IsNullOrEmpty(startInventoryItemId))
                                {
                                    whereStartInventoryItemId = " docNumber>='" + startInventoryItemId.Trim() + "' and docNumber<='" + endInventoryItemId.Trim() + "'";
                                }
                                else
                                {
                                    whereEndInventoryItemId = " docNumber<='" + endInventoryItemId.Trim() + "'";
                                }
                            }
                            sWhereId = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(sWhereId, whereStartInventoryItemId);
                            sWhereId = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(sWhereId, whereEndInventoryItemId);
                            if (!string.IsNullOrEmpty(sWhereId))
                                sWhere = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(sWhereId, sWhere);
                            listAscmMaterialItem = AscmMaterialItemService.GetInstance().GetList(ynPage, "docNumber", "", "", "", "", sWhere);
                            if (listAscmMaterialItem != null && listAscmMaterialItem.Count() > 0)
                            {
                                foreach (AscmMaterialItem ascmMaterialItem in listAscmMaterialItem)
                                {
                                    jsonDataGridResult.rows.Add(ascmMaterialItem);
                                }
                            }
                        }
                    }
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                //jsonDataGridResult.message = ex.Message;
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }