Пример #1
0
        protected void ShowImage(string item)
        {
            if (item.Length < 18)
            {
                return;
            }
            PublicAppDAL paADL    = new PublicAppDAL();
            clsPublic    cpb      = new clsPublic();
            string       imgAdd_s = "/cf_art/artwork/AAAA/A588001.bmp";                                                //源文件
            string       art_file = paADL.GetArtWorkImagePath(item);                                                   //獲取ArtWork源文件

            imgAdd_s = DBUtility.image_map_path + art_file;                                                            //獲取源文件完整文件路徑
            int      str_start = art_file.IndexOf("/");
            string   imgAdd_d  = "file/image/" + art_file.Substring(str_start + 1, art_file.Length - (str_start + 1)); //"xls/A588001.bmp";
            FileInfo file_s    = new FileInfo(Server.MapPath(imgAdd_s));                                               //指定源文件路径
            FileInfo file_d    = new FileInfo(Server.MapPath(imgAdd_d));                                               //指定目的文件路徑

            if (file_s.Exists)                                                                                         //判断源文件是否存在
            {
                //cls.clsPublic.WebMessageBox(this.Page, "找到源文件!");
                if (!file_d.Exists)//判断目的文件是否存在
                {
                    cpb.FileCopy(file_s.ToString(), file_d.ToString());
                }
            }
            else
            {
                //cls.clsPublic.WebMessageBox(this.Page, "沒找到ArtWork圖片!");
            }



            imgZp.ImageUrl = imgAdd_d;
        }
Пример #2
0
        private void UpdateOC(HttpContext context)
        {
            clsPublic cls         = new clsPublic();
            string    ReturnValue = string.Empty;
            string    remote_db   = DBUtility.remote_db;
            string    within_code = DBUtility.within_code;
            //string updated = context.Request["updated"];

            BasePage bp = new BasePage();
            string   userId = bp.getUserName();
            string   para = context.Request["updated"];
            string   mo_id = "";
            string   regions = "";
            string   req_mock_up = "", rec_mock_up = "";
            string   data_sheet_pre = "", data_sheet_sent = "";
            string   result = "";
            JArray   ja     = (JArray)JsonConvert.DeserializeObject(para);

            for (int i = 0; i < ja.Count; i++)
            {
                mo_id           = ja[i]["mo_id"].ToString().Trim();
                regions         = ja[i]["regions"] != null ? ja[i]["regions"].ToString().Trim() : "";
                req_mock_up     = ja[i]["req_mock_up"] != null ? ja[i]["req_mock_up"].ToString().Trim() : "";
                rec_mock_up     = ja[i]["rec_mock_up"] != null ? ja[i]["rec_mock_up"].ToString().Trim() : "";
                data_sheet_pre  = ja[i]["data_sheet_pre"] != null ? ja[i]["data_sheet_pre"].ToString().Trim() : "";
                data_sheet_sent = ja[i]["data_sheet_sent"] != null ? ja[i]["data_sheet_sent"].ToString().Trim() : "";
                string strSql      = "";
                string create_time = System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
                strSql += string.Format(@" SET XACT_ABORT  ON ");
                strSql += string.Format(@" BEGIN TRANSACTION ");
                if (!FindMo(mo_id))
                {
                    strSql += string.Format(@"Insert Into so_polo_order_trace (mo_id,regions,req_mock_up,rec_mock_up,data_sheet_pre,data_sheet_sent,create_user,create_time) Values " +
                                            "('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')"
                                            , mo_id, regions, req_mock_up, rec_mock_up, data_sheet_pre, data_sheet_sent, userId, create_time);
                }
                else
                {
                    strSql += string.Format(@"Update so_polo_order_trace Set regions='{0}',req_mock_up='{1}',rec_mock_up='{2}',data_sheet_pre='{3}'" +
                                            ",data_sheet_sent='{4}',update_user='******',update_time='{6}'" +
                                            " Where mo_id='{7}'"
                                            , regions, req_mock_up, rec_mock_up, data_sheet_pre, data_sheet_sent, userId, create_time, mo_id);
                }
                strSql += string.Format(@" COMMIT TRANSACTION ");
                result  = sh.ExecuteSqlUpdate(strSql);
                if (result == "")
                {
                    ReturnValue = "更新記錄成功!";
                }
                else
                {
                    ReturnValue = "更新記錄失敗!";
                    break;
                }
            }
            context.Response.ContentType = "text/plain";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            clsPublic cls = new clsPublic();
            DataTable dt  = new DataTable();

            dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().get_unit();
            var ReturnValue = cls.DataTableJsonReturnTable(dt);

            Response.Write(ReturnValue);
        }
Пример #4
0
        public void GetItem(HttpContext context)
        {
            clsPublic cls = new clsPublic();
            BasePage  bp = new BasePage();
            string    ReturnValue = string.Empty;
            string    Loc_no = "";
            string    Prd_mo_from = "", Prd_mo_to = "";
            string    Prd_item_from = "", Prd_cdesc = "";
            string    Zero_flag = "";
            string    para      = context.Request["param"];

            if (para != null)
            {
                JArray ja = (JArray)JsonConvert.DeserializeObject(para);
                Loc_no        = ja[0]["Loc_no"].ToString().Trim();
                Prd_mo_from   = ja[0]["Prd_mo_from"].ToString().Trim();
                Prd_mo_to     = ja[0]["Prd_mo_to"].ToString().Trim();
                Prd_item_from = ja[0]["Prd_item_from"].ToString().Trim();
                Prd_cdesc     = ja[0]["Prd_cdesc"].ToString().Trim();
                Zero_flag     = ja[0]["Zero_flag"].ToString().Trim();
            }
            else
            {
                Loc_no        = context.Request["Loc_no"] != null ? context.Request["Loc_no"] : "";
                Prd_mo_from   = context.Request["Prd_mo_from"] != null ? context.Request["Prd_mo_from"] : "";
                Prd_mo_to     = context.Request["Prd_mo_to"] != null ? context.Request["Prd_mo_to"] : "";
                Prd_item_from = context.Request["Prd_item_from"] != null ? context.Request["Prd_item_from"] : "";
                Prd_cdesc     = context.Request["Prd_cdesc"] != null ? context.Request["Prd_cdesc"] : "";
                Zero_flag     = context.Request["Zero_flag"] != null ? context.Request["Zero_flag"] : "";
            }
            //if (Loc_no == "" && Prd_mo_from == "" && Prd_mo_to == "" && Prd_item_from == "" && Prd_cdesc == "")
            //{

            //}
            //else
            //{
            string strSql = "usp_st_jx_store_summary";

            SqlParameter[] parameters = { new SqlParameter("@Loc_no", Loc_no)
                                          ,                           new SqlParameter("@Prd_mo_from",   Prd_mo_from),   new SqlParameter("@Prd_mo_to", Prd_mo_to)
                                          ,                           new SqlParameter("@Prd_item_from", Prd_item_from), new SqlParameter("@Prd_cdesc", Prd_cdesc)
                                          ,                           new SqlParameter("@zero_flag",     Zero_flag) };

            DataTable dt = SQLHelper.ExecuteProcedureRetrunDataTable(strSql, parameters);


            ReturnValue = cls.DataTableJsonReturnExcel(dt);    //提取記錄,返回給表格
            //}
            context.Response.ContentType = "text/plain";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #5
0
        public void GetStoreTransfer(HttpContext context)
        {
            clsPublic cls = new clsPublic();
            BasePage  bp = new BasePage();
            string    ReturnValue = string.Empty;
            string    Loc_no = "";
            string    Date_from = "", Date_to = "";
            string    Prd_mo_from = "", Prd_mo_to = "";
            string    Prd_item_from = "", Prd_item_to = "";
            string    para = context.Request["param"];

            if (para != null)
            {
                JArray ja = (JArray)JsonConvert.DeserializeObject(para);
                Loc_no        = ja[0]["Loc_no"].ToString().Trim();
                Date_from     = ja[0]["Date_from"].ToString().Trim();
                Date_to       = ja[0]["Date_to"].ToString().Trim();
                Prd_mo_from   = ja[0]["Prd_mo_from"].ToString().Trim();
                Prd_mo_to     = ja[0]["Prd_mo_to"].ToString().Trim();
                Prd_item_from = ja[0]["Prd_item_from"].ToString().Trim();
                Prd_item_to   = ja[0]["Prd_item_to"].ToString().Trim();
            }
            else
            {
                Loc_no        = context.Request["Loc_no"] != null ? context.Request["Loc_no"] : "";
                Date_from     = context.Request["Date_from"] != null ? context.Request["Date_from"] : "";
                Date_to       = context.Request["Date_to"] != null ? context.Request["Date_to"] : "";
                Prd_mo_from   = context.Request["Prd_mo_from"] != null ? context.Request["Prd_mo_from"] : "";
                Prd_mo_to     = context.Request["Prd_mo_to"] != null ? context.Request["Prd_mo_to"] : "";
                Prd_item_from = context.Request["Prd_item_from"] != null ? context.Request["Prd_item_from"] : "";
                Prd_item_to   = context.Request["Prd_item_to"] != null ? context.Request["Prd_item_to"] : "";
            }
            if (Loc_no == "" && Date_from == "" && Date_to == "" && Prd_mo_from == "" && Prd_mo_to == "" && Prd_item_from == "" && Prd_item_to == "")
            {
            }
            else
            {
                string         strSql     = "usp_st_jx_store_transfer";
                SqlParameter[] parameters = { new SqlParameter("@Loc_no", Loc_no)
                                              ,                           new SqlParameter("@Date_from",     Date_from),     new SqlParameter("@Date_to", Date_to)
                                              ,                           new SqlParameter("@Prd_mo_from",   Prd_mo_from),   new SqlParameter("@Prd_mo_to", Prd_mo_to)
                                              ,                           new SqlParameter("@Prd_item_from", Prd_item_from), new SqlParameter("@Prd_item_to", Prd_item_to) };

                DataTable dt = SQLHelper.ExecuteProcedureRetrunDataTable(strSql, parameters);


                ReturnValue = cls.DataTableJsonReturnExcel(dt);//提取記錄,返回給表格
            }
            context.Response.ContentType = "text/plain";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #6
0
        public void GetPrdItem(HttpContext context)
        {
            clsPublic cls         = new clsPublic();
            string    ReturnValue = string.Empty;
            string    Prd_item    = context.Request["Prd_item"] != null ? context.Request["Prd_item"] : "";
            string    strSql      = "Select id,name As goods_name From geo_it_goods Where id='" + Prd_item + "'";
            DataTable dt          = sh.ExecuteSqlReturnDataTable(strSql);

            ReturnValue = cls.DataTableJsonReturnExcel(dt);//提取記錄,返回給表格

            context.Response.ContentType = "text/plain";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #7
0
        public void GetItemDetails(HttpContext context)
        {
            clsPublic cls = new clsPublic();
            BasePage  bp = new BasePage();
            string    ReturnValue = string.Empty;
            string    prdDep = "";
            string    moFrom = "", moTo = "";
            string    dateFrom = "", dateTo = "";
            string    productType = "";
            string    para        = context.Request["param"];

            if (para != null)
            {
                JArray ja = (JArray)JsonConvert.DeserializeObject(para);
                prdDep      = ja[0]["prdDep"].ToString().Trim();
                moFrom      = ja[0]["moFrom"].ToString().Trim();
                moTo        = ja[0]["moTo"].ToString().Trim();
                dateFrom    = ja[0]["dateFrom"].ToString().Trim();
                dateTo      = ja[0]["dateTo"].ToString().Trim();
                productType = ja[0]["productType"].ToString().Trim();
            }
            else
            {
                prdDep      = context.Request["prdDep"] != null ? context.Request["prdDep"] : "";
                moFrom      = context.Request["moFrom"] != null ? context.Request["moFrom"] : "";
                moTo        = context.Request["moTo"] != null ? context.Request["moTo"] : "";
                dateFrom    = context.Request["dateFrom"] != null ? context.Request["dateFrom"] : "";
                dateTo      = context.Request["dateTo"] != null ? context.Request["dateTo"] : "";
                productType = context.Request["productType"] != null ? context.Request["productType"] : "";
            }
            if (prdDep == "" && moFrom == "" && moTo == "" && productType == "" && dateFrom == "" & dateTo == "")
            {
            }
            else
            {
                string strSql = "usp_DepProductStatus";

                SqlParameter[] parameters = { new SqlParameter("@dep", prdDep)
                                              ,                        new SqlParameter("@dateFrom",    dateFrom), new SqlParameter("@dateTo", dateTo)
                                              ,                        new SqlParameter("@moFrom",      moFrom),   new SqlParameter("@moTo", moTo)
                                              ,                        new SqlParameter("@productType", @productType)
                                              ,                        new SqlParameter("@isComplete", 1) };

                DataTable dt = SQLHelper.ExecuteProcedureRetrunDataTable(strSql, parameters);
                ReturnValue = cls.DataTableJsonReturnExcel(dt);//提取記錄,返回給表格
            }
            context.Response.ContentType = "text/plain";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #8
0
        public void GetItem(HttpContext context)
        {
            clsPublic cls         = new clsPublic();
            BasePage  bp          = new BasePage();
            string    ReturnValue = string.Empty;
            int       rpt_type    = 0;

            rpt_type = context.Request["rpt_type"] != null?Convert.ToInt32(context.Request["rpt_type"]) : 0;

            string date1  = context.Request["date_from"] != null ? context.Request["date_from"] : "";
            string date2  = context.Request["date_to"] != null ? context.Request["date_to"] : "";
            string brand1 = context.Request["brand_from"] != null ? context.Request["brand_from"] : "";
            string brand2 = context.Request["brand_to"] != null ? context.Request["brand_to"] : "";
            string cust1  = context.Request["cust_from"] != null ? context.Request["cust_from"] : "";
            string cust2  = context.Request["cust_to"] != null ? context.Request["cust_to"] : "";
            string mo1    = context.Request["mo_from"] != null ? context.Request["mo_from"] : "";
            string mo2    = context.Request["mo_to"] != null ? context.Request["mo_to"] : "";

            if (date1 == "" && date2 == "" && brand1 == "" && brand2 == "" && cust1 == "" && cust2 == "" && mo1 == "" && mo2 == "")
            {
                mo1 = "2000/01/01";
                mo2 = "2000/01/01";
            }
            string strSql = "usp_iv_salesByProductType";

            SqlParameter[] parameters = { new SqlParameter("@user_id", bp.getUserName())
                                          ,                            new SqlParameter("@rpt_type",rpt_type)
                                          ,                            new SqlParameter("@date1",  date1),  new SqlParameter("@date2", date2)
                                          ,                            new SqlParameter("@brand1", brand1), new SqlParameter("@brand2", brand2)
                                          ,                            new SqlParameter("@cust1",  cust1),  new SqlParameter("@cust2", cust2)
                                          ,                            new SqlParameter("@mo1",    mo1),    new SqlParameter("@mo2", mo2) };

            DataTable dt = SQLHelper.ExecuteProcedureRetrunDataTable(strSql, parameters);


            //DataTable dt = SQLHelper.ExecuteSqlReturnDataTable("select flag_id,flag_desc from bs_flag_desc");

            //if (paraa == "get_oc_a")
            //{

            //    ReturnValue = cls.DataTableJsonReturnTextBox(dt);//提取記錄,返回給文本框
            //}
            //else
            ReturnValue = cls.DataTableJsonReturnExcel(dt);//提取記錄,返回給表格

            context.Response.ContentType = "text/plain";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #9
0
        protected void getArrangeWorker(HttpContext context)
        {
            clsPublic cls         = new clsPublic();
            string    ReturnValue = string.Empty;
            string    arrange_id  = context.Request["arrange_id"] != null ? context.Request["arrange_id"] : "";
            string    para        = context.Request["param"];
            string    strSql      = "Select * From dgcf_pad.dbo.product_arrange_worker Where arrange_id='" + arrange_id + "'";
            DataTable dt          = sh.ExecuteSqlReturnDataTable(strSql);

            ReturnValue = cls.DataTableJsonReturnExcel(dt);//提取記錄,返回給表格

            context.Response.ContentType = "text/plain";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #10
0
        protected void btnExpToExcel_Click(object sender, EventArgs e)
        {
            //showMsg.Visible = true;
            //System.Threading.Thread.Sleep(10 * 1000);
            //showMsg.Visible = false;
            //return;
            string content  = getExcelContent();
            string css      = ".firstTR td{color:blue;width:100px;}.secondTR td{color:blue;width:100px;}";
            string filename = "制單追蹤表.xls";

            filename = System.Web.HttpUtility.UrlEncode(filename, System.Text.Encoding.UTF8);
            clsPublic cl = new clsPublic();

            cl.ExportToExcel(filename, content, css);
        }
Пример #11
0
        private void expData(int rpt_type, DataTable dt)
        {
            string content  = getExcelContent(rpt_type, dt);
            string css      = ".firstTR td{color:blue;width:100px;}.secondTR td{color:blue;width:100px;}";
            string filename = "訂單記錄總表.xls";

            if (rpt_type == 2)
            {
                filename = "訂單記錄明細表.xls";
            }
            filename = System.Web.HttpUtility.UrlEncode(filename, System.Text.Encoding.UTF8);
            clsPublic cl = new clsPublic();

            cl.ExportToExcel(filename, content, css);
        }
Пример #12
0
        public void GetItem(HttpContext context)
        {
            string    paraa       = context.Request["paraa"];
            string    ReturnValue = string.Empty;
            clsPublic cls         = new clsPublic();
            //BasicInformationFacade basicInformationFacade = new BasicInformationFacade();   //实例化基础信息外观
            DataTable dt = new DataTable();

            //dt = basicInformationFacade.itemsQuery(); //根据查询条件获取结果
            if (paraa == "getquotation")
            {
                string prd_item = context.Request["prd_item"];
                if (prd_item == null)
                {
                    prd_item = "";
                }
                string clr = context.Request["clr"];
                if (clr == null)
                {
                    clr = "";
                }
                string size = context.Request["size"];
                if (size == null || size == "")
                {
                    size = "";
                }
                dt          = Leyp.SQLServerDAL.Sales.Factory_New.SaQuotationQueryDAL().getQuotation(prd_item, clr, size);
                ReturnValue = cls.DataTableJsonReturnTable(dt);//提取記錄,返回給表格
            }
            else
            if (paraa == "get_color")
            {
                int    select_type = 1;// context.Request["select_type"];
                string select_val  = context.Request["select_val"];
                dt          = Leyp.SQLServerDAL.Sales.Factory_New.SaQuotationQueryDAL().getColor(select_type, select_val);
                ReturnValue = cls.DataTableJsonReturnList(dt);
            }


            //clsPublic cls = new clsPublic();
            //ReturnValue = cls.DataTableJson(dt);
            //ReturnValue = DataTableJson(dt);
            context.Response.ContentType = "text/plain";
            //ReturnValue = "[{'dep_id':'101','dep_cdesc':'鈕 - 工程科'},{'dep_id':'102','dep_cdesc':'鈕 - 啤機'}]";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #13
0
        public void GetItem(HttpContext context)
        {
            clsPublic cls         = new clsPublic();
            BasePage  bp          = new BasePage();
            string    ReturnValue = string.Empty;

            string dat1 = "", dat2 = "";
            string sea = "";
            string mo_group = "";// dlMo_group.Text;
            string brand1 = "", brand2 = "";
            string cust_goods = "";
            string para       = context.Request["param"];

            JArray ja = (JArray)JsonConvert.DeserializeObject(para);

            dat1       = ja[0]["dat1"].ToString().Trim();
            dat2       = ja[0]["dat2"].ToString().Trim();
            mo_group   = ja[0]["mo_group"].ToString().Trim();
            brand1     = ja[0]["brand1"].ToString().Trim();
            brand2     = ja[0]["brand2"].ToString().Trim();
            sea        = ja[0]["season"].ToString().Trim();
            cust_goods = ja[0]["cust_goods"].ToString().Trim();

            string strSql = "usp_mo_find_season";

            SqlParameter[] parameters = { new SqlParameter("@sea", sea)
                                          ,                        new SqlParameter("@mo_group", mo_group)
                                          ,                        new SqlParameter("@dat1", dat1)
                                          ,                        new SqlParameter("@dat2", dat2)
                                          ,                        new SqlParameter("@brand1", brand1)
                                          ,                        new SqlParameter("@brand2", brand2)
                                          ,                        new SqlParameter("@cust_goods", cust_goods) };


            DataTable dt = SQLHelper.ExecuteProcedureRetrunDataTable(strSql, parameters);



            ReturnValue = cls.DataTableJsonReturnExcel(dt);//提取記錄,返回給表格

            context.Response.ContentType = "text/plain";
            //ReturnValue = "[{'dep_id':'101','dep_cdesc':'鈕 - 工程科'},{'dep_id':'102','dep_cdesc':'鈕 - 啤機'}]";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #14
0
        public void GetItem(HttpContext context)
        {
            clsPublic cls = new clsPublic();
            BasePage  bp = new BasePage();
            string    ReturnValue = string.Empty;
            string    Date_from = "", Date_to = "";
            string    para = context.Request["param"];

            if (para != null)
            {
                JArray ja = (JArray)JsonConvert.DeserializeObject(para);
                Date_from = ja[0]["Date_from"].ToString().Trim();
                Date_to   = ja[0]["Date_to"].ToString().Trim();
            }
            else
            {
                Date_from = context.Request["Date_from"] != null ? context.Request["Date_from"] : "";
                Date_to   = context.Request["Date_to"] != null ? context.Request["Date_to"] : "";
            }
            if (Date_from == "" && Date_to == "")
            {
                Date_from = "1900/01/01";
                Date_to   = "1900/01/01";
            }
            string strSql = "usp_LoadLandInv";

            SqlParameter[] parameters = { new SqlParameter("@dat1", Date_from), new SqlParameter("@dat2", Date_to) };

            DataTable dt = SQLHelper.ExecuteProcedureRetrunDataTable(strSql, parameters);


            ReturnValue = cls.DataTableJsonReturnExcel(dt);//提取記錄,返回給表格

            context.Response.ContentType = "text/plain";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #15
0
        public void GetItem(HttpContext context)
        {
            clsPublic cls         = new clsPublic();
            BasePage  bp          = new BasePage();
            string    ReturnValue = string.Empty;

            string crdate1 = "", crdate2 = "";
            string date1 = "", date2 = "";
            string mo1 = "", mo2 = "";
            string mo_group = "";
            string cs_date1 = "", cs_date2 = "";
            string crby       = "";
            string brand1     = "";
            string cust1      = "";
            string agent1     = "";
            string cust_goods = "";
            string cust_color = "";
            string cust_style = "";
            string season     = "";
            string mat_code   = "";
            string prod_code  = "";
            string art_code   = "";
            string size_code  = "";
            string clr_code   = "";
            string pono       = "";
            string ocno       = "";
            string goods_id   = "";

            int    period_type    = 0;
            string period_type1   = "";
            string only_apart     = "";
            string only_apart_chk = "";
            string para           = context.Request["param"];

            if (para != null)
            {
                JArray ja = (JArray)JsonConvert.DeserializeObject(para);
                crdate1    = ja[0]["crdate1"].ToString().Trim();
                crdate2    = ja[0]["crdate2"].ToString().Trim();
                date1      = ja[0]["date1"].ToString().Trim();
                date2      = ja[0]["date2"].ToString().Trim();
                mo1        = ja[0]["mo1"].ToString().Trim();
                mo2        = ja[0]["mo2"].ToString().Trim();
                mo_group   = ja[0]["mo_group"].ToString().Trim();
                cs_date1   = ja[0]["cs_date1"].ToString().Trim();
                cs_date2   = ja[0]["cs_date2"].ToString().Trim();
                crby       = ja[0]["crby"].ToString().Trim();
                brand1     = ja[0]["brand1"].ToString().Trim();
                cust1      = ja[0]["cust1"].ToString().Trim();
                agent1     = ja[0]["agent1"].ToString().Trim();
                cust_goods = ja[0]["cust_goods"].ToString().Trim();
                cust_color = ja[0]["cust_color"].ToString().Trim();
                pono       = ja[0]["pono"].ToString().Trim();
                season     = ja[0]["season"].ToString().Trim();
                ocno       = ja[0]["ocno"].ToString().Trim();
                goods_id   = ja[0]["goods_id"].ToString().Trim();
                cust_style = ja[0]["cust_style"].ToString().Trim();


                period_type1   = ja[0]["period_type"].ToString().Trim();
                only_apart_chk = ja[0]["only_apart_chk"].ToString().Trim();
                if (only_apart_chk == "True")
                {
                    only_apart = "1";
                }
            }
            else
            {
                crdate1        = context.Request["crdate1"];
                crdate2        = context.Request["crdate2"];
                date1          = context.Request["date1"];
                date2          = context.Request["date2"];
                mo1            = context.Request["mo_from"];
                mo2            = context.Request["mo_to"];
                mo_group       = context.Request["mo_group"];
                cs_date1       = context.Request["cs_date1"];
                cs_date2       = context.Request["cs_date2"];
                crby           = context.Request["crby"];
                brand1         = context.Request["brand1"];
                cust1          = context.Request["cust1"];
                agent1         = context.Request["agent1"];
                cust_goods     = context.Request["cust_goods"];
                cust_color     = context.Request["cust_color"];
                cust_style     = context.Request["cust_style"];
                season         = context.Request["season"];
                mat_code       = context.Request["mat_code"];
                prod_code      = context.Request["prod_code"];
                art_code       = context.Request["art_code"];
                size_code      = context.Request["size_code"];
                clr_code       = context.Request["clr_code"];
                pono           = context.Request["pono"];
                ocno           = context.Request["ocno"];
                goods_id       = context.Request["goods_id"];
                period_type1   = context.Request["period_type"];
                only_apart_chk = context.Request["only_apart"];
                if (only_apart_chk == "on")
                {
                    only_apart = "1";
                }
            }
            if (crdate1 == null || crdate1 == "")
            {
                crdate1 = "";
            }
            if (crdate2 == null || crdate2 == "")
            {
                crdate2 = "";
            }
            if (date1 == null || date1 == "")
            {
                date1 = "";
            }
            if (date2 == null || date2 == "")
            {
                date2 = "";
            }
            if (mo1 == null)
            {
                mo1 = "";
            }
            if (mo2 == null)
            {
                mo2 = "";
            }
            if (mo_group == null)
            {
                mo_group = "";
            }
            if (cs_date1 == null || cs_date1 == "")
            {
                cs_date1 = "";
            }
            if (cs_date2 == null || cs_date2 == "")
            {
                cs_date2 = "";
            }
            if (crby == null || crby == "")
            {
                crby = "";
            }
            if (brand1 == null || brand1 == "")
            {
                brand1 = "";
            }
            if (cust1 == null || cust1 == "")
            {
                cust1 = "";
            }
            if (agent1 == null || agent1 == "")
            {
                agent1 = "";
            }
            if (cust_goods == null || cust_goods == "")
            {
                cust_goods = "";
            }
            if (cust_color == null || cust_color == "")
            {
                cust_color = "";
            }
            if (cust_style == null || cust_style == "")
            {
                cust_style = "";
            }
            if (season == null || season == "")
            {
                season = "";
            }
            if (mat_code == null || mat_code == "")
            {
                mat_code = "";
            }
            if (prod_code == null || prod_code == "")
            {
                prod_code = "";
            }
            if (art_code == null || art_code == "")
            {
                art_code = "";
            }
            if (size_code == null || size_code == "")
            {
                size_code = "";
            }
            if (clr_code == null || clr_code == "")
            {
                clr_code = "";
            }
            if (pono == null || pono == "")
            {
                pono = "";
            }
            if (ocno == null || ocno == "")
            {
                ocno = "";
            }
            if (goods_id == null || goods_id == "")
            {
                goods_id = "";
            }
            if (period_type1 == null || period_type1 == "" || period_type1 == "00")
            {
                period_type = 0;
            }
            else
            {
                if (period_type1 == "01")
                {
                    period_type = 1;
                }
                else
                {
                    if (period_type1 == "02")
                    {
                        period_type = 2;
                    }
                    else
                    {
                        if (period_type1 == "03")
                        {
                            period_type = 3;
                        }
                        else
                        {
                            if (period_type1 == "04")
                            {
                                period_type = 4;
                            }
                            else
                            {
                                if (period_type1 == "05")
                                {
                                    period_type = 5;
                                }
                                else
                                {
                                    if (period_type1 == "06")
                                    {
                                        period_type = 6;
                                    }
                                }
                            }
                        }
                    }
                }
            }

            if (mo1 == "" && mo2 == "" && crdate1 == "" && crdate2 == "" && date1 == "" && date2 == "" && brand1 == "" && cust1 == "" && mo_group == "")
            {
                date1  = System.DateTime.Now.ToString("yyyy/MM/dd");
                date2  = date1;
                mo1    = "ZZZZZZZZZ";
                mo2    = "ZZZZZZZZZ";
                brand1 = "ZZZZZZZZ";
                cust1  = "ZZZZZZZZ";
            }
            string strSql = "usp_Oc_NoCompleteOc";

            if (period_type >= 5)
            {
                strSql = "usp_Oc_NoCompleteOc601";
            }
            SqlParameter[] parameters = { new SqlParameter("@user_id", bp.getUserName())
                                          ,                            new SqlParameter("@period_type",period_type)
                                          ,                            new SqlParameter("@mo_group",   mo_group)
                                          ,                            new SqlParameter("@only_apart", only_apart)
                                          ,                            new SqlParameter("@crdat1",     crdate1),  new SqlParameter("@crdat2", crdate2)
                                          ,                            new SqlParameter("@dat1",       date1),    new SqlParameter("@dat2", date2)
                                          ,                            new SqlParameter("@cs_dat1",    cs_date1), new SqlParameter("@cs_dat2", cs_date2)
                                          ,                            new SqlParameter("@crby",       crby)
                                          ,                            new SqlParameter("@mo1",        mo1),      new SqlParameter("@mo2", mo2)
                                          ,                            new SqlParameter("@brand1",     brand1)
                                          ,                            new SqlParameter("@cust1",      cust1)
                                          ,                            new SqlParameter("@agent1",     agent1)
                                          ,                            new SqlParameter("@cust_goods", cust_goods)
                                          ,                            new SqlParameter("@cust_color", cust_color)
                                          ,                            new SqlParameter("@cust_style", cust_style)
                                          ,                            new SqlParameter("@season",     season)
                                          ,                            new SqlParameter("@mat_code",   mat_code)
                                          ,                            new SqlParameter("@prod_code",  prod_code)
                                          ,                            new SqlParameter("@art_code",   art_code)
                                          ,                            new SqlParameter("@size_code",  size_code)
                                          ,                            new SqlParameter("@clr_code",   clr_code)
                                          ,                            new SqlParameter("@pono",       pono)
                                          ,                            new SqlParameter("@ocno",       ocno)
                                          ,                            new SqlParameter("@goods_id",   goods_id) };

            DataTable dt = SQLHelper.ExecuteProcedureRetrunDataTable(strSql, parameters);


            //DataTable dt = SQLHelper.ExecuteSqlReturnDataTable("select flag_id,flag_desc from bs_flag_desc");

            //if (paraa == "get_oc_a")
            //{

            //    ReturnValue = cls.DataTableJsonReturnTextBox(dt);//提取記錄,返回給文本框
            //}
            //else
            ReturnValue = cls.DataTableJsonReturnExcel(dt);//提取記錄,返回給表格

            context.Response.ContentType = "text/plain";
            //ReturnValue = "[{'dep_id':'101','dep_cdesc':'鈕 - 工程科'},{'dep_id':'102','dep_cdesc':'鈕 - 啤機'}]";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #16
0
        public void GetItem(HttpContext context)
        {
            string    paraa       = context.Request["paraa"];
            string    ReturnValue = string.Empty;
            clsPublic cls         = new clsPublic();
            //BasicInformationFacade basicInformationFacade = new BasicInformationFacade();   //实例化基础信息外观
            DataTable dt = new DataTable();

            //dt = basicInformationFacade.itemsQuery(); //根据查询条件获取结果
            if (paraa == "get_initInterface")
            {
                string formname = context.Request["formname"];
                string obj_type = context.Request["obj_type"];
                dt          = initInterfaceData(formname, obj_type);
                ReturnValue = cls.DataTableJsonReturnList(dt);
            }
            else
            {
                if (paraa == "get_unit")
                {
                    dt          = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().getUnit();
                    ReturnValue = cls.DataTableJsonReturnList(dt);//提取記錄,返回給列表框的數據源
                }
                else
                {
                    if (paraa == "get_season")
                    {
                        dt          = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().getSeason();
                        ReturnValue = cls.DataTableJsonReturnList(dt);
                    }
                    else
                    {
                        if (paraa == "update")
                        {
                            //ReturnValue = updateProcess(context);
                        }
                        else
                        {
                            if (paraa == "get_custuser")
                            {
                                dt          = getCustByUser();
                                ReturnValue = cls.DataTableJsonReturnList(dt);
                            }
                            else
                            {
                                if (paraa == "update_order")
                                {
                                    ReturnValue = updateProcess(context);
                                }
                                else
                                {
                                    if (paraa == "getorder_a" || paraa == "getorder_b")
                                    {
                                        dt = getOrder(context);
                                        if (dt.Rows.Count > 0)
                                        {
                                            if (paraa == "getorder_a")
                                            {
                                                ReturnValue = cls.DataTableJsonReturnTextBox(dt);//提取記錄,返回給文本框
                                            }
                                            else
                                            {
                                                ReturnValue = cls.DataTableJsonReturnTable(dt);//提取記錄,返回給表格
                                            }
                                        }
                                        else
                                        {
                                            ReturnValue = "沒有找到記錄!";
                                        }
                                    }
                                    else
                                    {
                                        if (paraa == "get_color")
                                        {
                                            int    select_type = 1;// context.Request["select_type"];
                                            string select_val  = context.Request["select_val"];
                                            dt          = Leyp.SQLServerDAL.Sales.Factory_New.SaColorGroupFindDAL().getColor(select_type, select_val);
                                            ReturnValue = cls.DataTableJsonReturnList(dt);
                                        }
                                        else
                                        {
                                            if (paraa == "delete_order")
                                            {
                                                ReturnValue = deleteOrderProcess(context);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            //clsPublic cls = new clsPublic();
            //ReturnValue = cls.DataTableJson(dt);
            //ReturnValue = DataTableJson(dt);
            context.Response.ContentType = "text/plain";
            //ReturnValue = "[{'dep_id':'101','dep_cdesc':'鈕 - 工程科'},{'dep_id':'102','dep_cdesc':'鈕 - 啤機'}]";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #17
0
        public void GetItem(HttpContext context)
        {
            clsPublic cls = new clsPublic();
            BasePage  bp = new BasePage();
            string    ReturnValue = string.Empty;
            int       rpt_type = 0;
            string    now_date_from = "", now_date_to = "";
            string    dep1 = "", dep2 = "";
            string    mo1 = "", mo2 = "";
            string    para = context.Request["param"];

            if (para != null)
            {
                JArray ja = (JArray)JsonConvert.DeserializeObject(para);
                rpt_type      = Convert.ToInt32(ja[0]["rpt_type"].ToString());
                now_date_from = ja[0]["now_date_from"].ToString().Trim();
                now_date_to   = ja[0]["now_date_to"].ToString().Trim();
                dep1          = ja[0]["dep_from"].ToString().Trim();
                dep2          = ja[0]["dep_to"].ToString().Trim();
                mo1           = ja[0]["mo_from"].ToString().Trim();
                mo2           = ja[0]["mo_to"].ToString().Trim();
            }
            else
            {
                rpt_type = context.Request["rpt_type"] != null?Convert.ToInt32(context.Request["rpt_type"]) : 0;

                now_date_from = context.Request["now_date_from"] != null ? context.Request["now_date_from"] : "";
                now_date_to   = context.Request["now_date_to"] != null ? context.Request["now_date_to"] : "";
                dep1          = context.Request["dep_from"] != null ? context.Request["dep_from"] : "";
                dep2          = context.Request["dep_to"] != null ? context.Request["dep_to"] : "";
                mo1           = context.Request["mo_from"] != null ? context.Request["mo_from"] : "";
                mo2           = context.Request["mo_to"] != null ? context.Request["mo_to"] : "";
            }
            if (now_date_from == "" && now_date_to == "" && dep1 == "" && dep2 == "" && mo1 == "" && mo2 == "")
            {
                now_date_from = "2000/01/01";
                now_date_to   = "2000/01/01";
                mo1           = "ZZZZZZZZZ";
                mo2           = "ZZZZZZZZZ";
            }
            string strSql = "usp_pd_depaverageproduct";

            SqlParameter[] parameters = { new SqlParameter("@rpt_type", rpt_type)
                                          ,                             new SqlParameter("@dep1", dep1),          new SqlParameter("@dep2", dep2)
                                          ,                             new SqlParameter("@dat1", now_date_from), new SqlParameter("@dat2", now_date_to)
                                          ,                             new SqlParameter("@mo1",  mo1),           new SqlParameter("@mo2", mo2) };

            DataTable dt = SQLHelper.ExecuteProcedureRetrunDataTable(strSql, parameters);


            //DataTable dt = SQLHelper.ExecuteSqlReturnDataTable("select flag_id,flag_desc from bs_flag_desc");

            //if (paraa == "get_oc_a")
            //{

            //    ReturnValue = cls.DataTableJsonReturnTextBox(dt);//提取記錄,返回給文本框
            //}
            //else
            ReturnValue = cls.DataTableJsonReturnExcel(dt);//提取記錄,返回給表格

            context.Response.ContentType = "text/plain";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #18
0
        public void GetItem(HttpContext context)
        {
            clsPublic cls = new clsPublic();
            BasePage  bp = new BasePage();
            string    ReturnValue = string.Empty;
            int       rpt_type = 0;
            int       data_type = 0;
            string    now_date_from = "", now_date_to = "";
            string    old_date_from = "", old_date_to = "";
            string    brand1 = "", brand2 = "";
            string    cust1 = "", cust2 = "";
            string    mo1 = "", mo2 = "";
            string    season1 = "", season2 = "";
            string    para = context.Request["param"];

            if (para != null)
            {
                JArray ja = (JArray)JsonConvert.DeserializeObject(para);
                rpt_type      = Convert.ToInt32(ja[0]["rpt_type"].ToString());
                now_date_from = ja[0]["now_date_from"].ToString().Trim();
                now_date_to   = ja[0]["now_date_to"].ToString().Trim();
                old_date_from = ja[0]["old_date_from"].ToString().Trim();
                old_date_to   = ja[0]["old_date_to"].ToString().Trim();
                brand1        = ja[0]["brand_from"].ToString().Trim();
                brand2        = ja[0]["brand_to"].ToString().Trim();
                cust1         = ja[0]["cust_from"].ToString().Trim();
                cust2         = ja[0]["cust_to"].ToString().Trim();
                mo1           = ja[0]["mo_from"].ToString().Trim();
                mo2           = ja[0]["mo_to"].ToString().Trim();
                season1       = ja[0]["season_from"].ToString().Trim();
                season2       = ja[0]["season_to"].ToString().Trim();
                if (ja[0]["data_type"].ToString().Trim() == "True")
                {
                    data_type = 1;
                }
            }
            else
            {
                rpt_type = context.Request["rpt_type"] != null?Convert.ToInt32(context.Request["rpt_type"]) : 0;

                now_date_from = context.Request["now_date_from"] != null ? context.Request["now_date_from"] : "";
                now_date_to   = context.Request["now_date_to"] != null ? context.Request["now_date_to"] : "";
                old_date_from = context.Request["old_date_from"] != null ? context.Request["old_date_from"] : "";
                old_date_to   = context.Request["old_date_to"] != null ? context.Request["old_date_to"] : "";
                brand1        = context.Request["brand_from"] != null ? context.Request["brand_from"] : "";
                brand2        = context.Request["brand_to"] != null ? context.Request["brand_to"] : "";
                cust1         = context.Request["cust_from"] != null ? context.Request["cust_from"] : "";
                cust2         = context.Request["cust_to"] != null ? context.Request["cust_to"] : "";
                mo1           = context.Request["mo_from"] != null ? context.Request["mo_from"] : "";
                mo2           = context.Request["mo_to"] != null ? context.Request["mo_to"] : "";
                season1       = context.Request["season_from"] != null ? context.Request["season_from"] : "";
                season2       = context.Request["season_to"] != null ? context.Request["season_to"] : "";
                if (context.Request["data_type"] == "on")
                {
                    data_type = 1;
                }
            }
            if (now_date_from == "" && now_date_to == "" && brand1 == "" && brand2 == "" && cust1 == "" && cust2 == "" && mo1 == "" && mo2 == "")
            {
                now_date_from = "2000/01/01";
                now_date_to   = "2000/01/01";
                old_date_from = "2000/01/01";
                old_date_to   = "2000/01/01";
            }
            string strSql = "usp_iv_salesByGroupBrand";

            SqlParameter[] parameters = { new SqlParameter("@data_type", data_type),                    new SqlParameter("@rpt_type", rpt_type)
                                          ,                              new SqlParameter("@now_date1", now_date_from),               new SqlParameter("@now_date2", now_date_to)
                                          ,                              new SqlParameter("@old_date1", old_date_from),               new SqlParameter("@old_date2", old_date_to)
                                          ,                              new SqlParameter("@brand1",    brand1),                      new SqlParameter("@brand2", brand2)
                                          ,                              new SqlParameter("@cust1",     cust1),                       new SqlParameter("@cust2", cust2)
                                          ,                              new SqlParameter("@mo1",       mo1),                         new SqlParameter("@mo2", mo2)
                                          ,                              new SqlParameter("@season1",   season1),                     new SqlParameter("@season2", season2) };

            DataTable dt = SQLHelper.ExecuteProcedureRetrunDataTable(strSql, parameters);


            //DataTable dt = SQLHelper.ExecuteSqlReturnDataTable("select flag_id,flag_desc from bs_flag_desc");

            //if (paraa == "get_oc_a")
            //{

            //    ReturnValue = cls.DataTableJsonReturnTextBox(dt);//提取記錄,返回給文本框
            //}
            //else
            ReturnValue = cls.DataTableJsonReturnExcel(dt);//提取記錄,返回給表格

            context.Response.ContentType = "text/plain";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #19
0
        public void GetStoreRequestDetails(HttpContext context)
        {
            clsPublic cls = new clsPublic();
            string    ReturnValue = string.Empty;
            string    Loc_no = "";
            string    Date_from = "", Date_to = "";
            string    Prd_mo_from = "", Prd_mo_to = "";
            string    Prd_item_from = "", Prd_item_to = "";
            string    Cpl_flag = "";
            string    para     = context.Request["param"];

            if (para != null)
            {
                JArray ja = (JArray)JsonConvert.DeserializeObject(para);
                Loc_no        = ja[0]["Loc_no"].ToString().Trim();
                Date_from     = ja[0]["Date_from"].ToString().Trim();
                Date_to       = ja[0]["Date_to"].ToString().Trim();
                Prd_mo_from   = ja[0]["Prd_mo_from"].ToString().Trim();
                Prd_mo_to     = ja[0]["Prd_mo_to"].ToString().Trim();
                Prd_item_from = ja[0]["Prd_item_from"].ToString().Trim();
                Prd_item_to   = ja[0]["Prd_item_to"].ToString().Trim();
                Cpl_flag      = ja[0]["Cpl_flag"].ToString().Trim();
            }
            else
            {
                Loc_no        = context.Request["Loc_no"] != null ? context.Request["Loc_no"] : "";
                Date_from     = context.Request["Date_from"] != null ? context.Request["Date_from"] : "";
                Date_to       = context.Request["Date_to"] != null ? context.Request["Date_to"] : "";
                Prd_mo_from   = context.Request["Prd_mo_from"] != null ? context.Request["Prd_mo_from"] : "";
                Prd_mo_to     = context.Request["Prd_mo_to"] != null ? context.Request["Prd_mo_to"] : "";
                Prd_item_from = context.Request["Prd_item_from"] != null ? context.Request["Prd_item_from"] : "";
                Prd_item_to   = context.Request["Prd_item_to"] != null ? context.Request["Prd_item_to"] : "";
                Cpl_flag      = context.Request["Cpl_flag"] != null ? context.Request["Cpl_flag"] : "";
            }
            if (Loc_no == "" && Date_from == "" && Date_to == "" && Prd_mo_from == "" && Prd_mo_to == "" && Prd_item_from == "" && Prd_item_to == "")
            {
            }
            else
            {
                string strSql = "Select a.*,b.name AS prd_item_cdesc" +
                                " From st_jx_store_request a " +
                                " Left Join geo_it_goods b ON a.prd_item=b.id" +
                                " Where a.id>=''";
                if (Loc_no != "")
                {
                    strSql += " And a.Loc_no='" + Loc_no + "'";
                }
                if (Date_from != "" && Date_to != "")
                {
                    strSql += " And a.request_date>='" + Date_from + "' And a.request_date<='" + Date_to + "'";
                }
                if (Prd_mo_from != "" && Prd_mo_to != "")
                {
                    strSql += " And a.prd_mo>='" + Prd_mo_from + "' And a.prd_mo<='" + Prd_mo_to + "'";
                }
                if (Prd_item_from != "" && Prd_item_to != "")
                {
                    strSql += " And a.prd_item>='" + Prd_item_from + "' And a.prd_item<='" + Prd_item_to + "'";
                }
                if (Cpl_flag == "0")
                {
                    strSql += " And a.cpl_flag='" + Cpl_flag + "'";
                }
                strSql += " Order By a.request_date Desc,a.id";
                DataTable dt = SQLHelper.ExecuteSqlReturnDataTable(strSql);


                ReturnValue = cls.DataTableJsonReturnExcel(dt);//提取記錄,返回給表格
            }
            context.Response.ContentType = "text/plain";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #20
0
        public void GetItem(HttpContext context)
        {
            string    paraa       = context.Request["paraa"];
            string    ReturnValue = string.Empty;
            clsPublic cls         = new clsPublic();
            //BasicInformationFacade basicInformationFacade = new BasicInformationFacade();   //实例化基础信息外观
            DataTable dt = new DataTable();
            //dt = basicInformationFacade.itemsQuery(); //根据查询条件获取结果
            string mo_id = context.Request["parab"];

            if (mo_id == null)
            {
                mo_id = "";
            }
            string mo_group = context.Request["mo_group"];

            if (mo_group == null)
            {
                mo_group = "";
            }
            string date_from = context.Request["date_from"];

            if (date_from == null || date_from == "")
            {
                date_from = "";
            }
            string date_to = context.Request["date_to"];

            if (date_to == null || date_to == "")
            {
                date_to = "";
            }
            else
            {
                date_to = Convert.ToDateTime(date_to).AddDays(1).ToString("yyyy/MM/dd");
            }
            string brand_from = context.Request["brand_from"];

            if (brand_from == null || brand_from == "")
            {
                brand_from = "";
            }
            string brand_to = context.Request["brand_to"];

            if (brand_to == null || brand_to == "")
            {
                brand_to = "";
            }
            if (date_from == "" && date_to == "" && brand_from == "" && brand_to == "" && mo_group == "")
            {
                brand_from = "ZZZZZZZZ";
                brand_to   = "ZZZZZZZZ";
            }
            SqlParameter[] parameters = { new SqlParameter("@dat1", date_from)
                                          ,                         new SqlParameter("@dat2", date_to)
                                          ,                         new SqlParameter("@brand1", brand_from)
                                          ,                         new SqlParameter("@brand2", brand_to)
                                          ,                         new SqlParameter("@mo_group", mo_group) };

            dt = SQLHelper.ExecuteProcedureRetrunDataTable("usp_Oc_CountOcByBrandGroup", parameters);


            if (paraa == "get_oc_a")
            {
                ReturnValue = cls.DataTableJsonReturnTextBox(dt);//提取記錄,返回給文本框
            }
            else
            {
                ReturnValue = cls.DataTableJsonReturnTable(dt);//提取記錄,返回給表格
            }
            //clsPublic cls = new clsPublic();
            //ReturnValue = cls.DataTableJson(dt);
            //ReturnValue = DataTableJson(dt);
            context.Response.ContentType = "text/plain";
            //ReturnValue = "[{'dep_id':'101','dep_cdesc':'鈕 - 工程科'},{'dep_id':'102','dep_cdesc':'鈕 - 啤機'}]";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #21
0
        protected DataTable getOrder(HttpContext context)
        {
            clsPublic cls = new clsPublic();
            string    id  = context.Request["id"];

            if (id == null)
            {
                id = "";
            }
            string pono = context.Request["pono"];

            if (pono == null)
            {
                pono = "";
            }
            string custcode = context.Request["custcode"];

            if (custcode == null)
            {
                custcode = getCustByUser().Rows[0]["custcode"].ToString();
            }
            string date_from = context.Request["date_from"];

            if (date_from == null || date_from == "")
            {
                date_from = "";
            }
            string date_to = context.Request["date_to"];

            if (date_to == null || date_to == "")
            {
                date_to = "";
            }
            else
            {
                date_to = Convert.ToDateTime(date_to).AddDays(1).ToString("yyyy/MM/dd");
            }
            string strSql = "Select a.id,a.custcode,a.pono,a.order_date,a.season,a.own,a.brand,a.cust_item,a.cust_item_cdesc,a.cust_color,a.cust_size" +
                            ",a.order_qty,a.unit,a.req_date,a.cf_prd_item,a.cf_color,a.cf_size,a.test_item,a.packing,a.crusr,Convert(Varchar(20),a.crtim,111) AS crtim" +
                            ",a.amusr,Convert(Varchar(20),a.amtim,111) AS amtim" +
                            " From so_cust_order a" +
                            " Where a.id>=''";

            if (id != "")
            {
                strSql += " And a.id='" + id + "'";
            }
            if (custcode != "")
            {
                strSql += " And a.custcode='" + custcode + "'";
            }
            if (pono != "")
            {
                strSql += " And a.pono like '" + "%" + pono + "%" + "'";
            }
            if (date_from != "" && date_to != "")
            {
                strSql += " And a.order_date>='" + date_from + "' And a.order_date<'" + date_to + "'";
            }
            DataTable dt = sh.ExecuteSqlReturnDataTable(strSql);

            return(dt);
        }
Пример #22
0
        public void getPlan(HttpContext context)
        {
            clsPublic cls = new clsPublic();
            BasePage  bp = new BasePage();
            string    ReturnValue = string.Empty;
            string    Prd_dep = "";
            string    Arrange_date = "";
            string    Prd_mo_from = "", Prd_mo_to = "";
            string    Prd_item_from = "";
            string    Dep_group     = "";
            string    strSql        = "";
            string    para          = context.Request["param"];

            if (para != null)
            {
                JArray ja = (JArray)JsonConvert.DeserializeObject(para);
                Prd_dep       = ja[0]["Prd_dep"].ToString().Trim();
                Arrange_date  = ja[0]["Arrange_date"].ToString().Trim();
                Prd_mo_from   = ja[0]["Prd_mo_from"].ToString().Trim();
                Prd_mo_to     = ja[0]["Prd_mo_to"].ToString().Trim();
                Prd_item_from = ja[0]["Prd_item_from"].ToString().Trim();
                Dep_group     = ja[0]["Dep_group"].ToString().Trim();
            }
            else
            {
                Prd_dep       = context.Request["Prd_dep"] != null ? context.Request["Prd_dep"] : "";
                Arrange_date  = context.Request["Arrange_date"] != null ? context.Request["Arrange_date"] : "";
                Prd_mo_from   = context.Request["Prd_mo_from"] != null ? context.Request["Prd_mo_from"] : "";
                Prd_mo_to     = context.Request["Prd_mo_to"] != null ? context.Request["Prd_mo_to"] : "";
                Prd_item_from = context.Request["Prd_item_from"] != null ? context.Request["Prd_item_from"] : "";
                Dep_group     = context.Request["Dep_group"] != null ? context.Request["Dep_group"] : "";
            }
            if (Prd_dep == "" && Arrange_date == "" && Prd_mo_from == "" && Prd_mo_to == "" && Prd_item_from == "" && Dep_group == "")
            {
                Prd_dep       = "ZZZ";
                Prd_mo_from   = "ZZZZZZZZZ";
                Prd_mo_to     = "ZZZZZZZZZ";
                Prd_item_from = "";
            }
            strSql = "Select a.arrange_id,a.now_date, a.prd_dep, a.prd_mo, a.prd_item,b.name AS prd_item_cdesc, a.mo_urgent,c.flag_cdesc" +
                     ", a.arrange_machine, a.arrange_date, a.arrange_seq, a.order_qty" +
                     ", a.order_date, a.req_f_date, a.req_qty, a.cpl_qty, a.arrange_qty, a.prd_cpl_qty, a.dep_rep_date,a.cust_o_date,a.dep_group " +
                     ",dgcf_pad.dbo.fn_getArrangeWorker(a.arrange_id) AS worker_gp,a.pre_prd_dep_date,a.pre_prd_dep_qty " +
                     " From dgcf_pad.dbo.product_arrange a " +
                     " Left Join geo_it_goods b On a.prd_item COLLATE chinese_taiwan_stroke_CI_AS=b.id " +
                     " Left Join bs_flag_desc c On a.mo_urgent COLLATE chinese_taiwan_stroke_CI_AS=c.flag_id " +
                     " Where a.arrange_id>'' And c.doc_type='mo_urgent_status' ";
            if (Prd_dep != "")
            {
                strSql += " And a.prd_dep='" + Prd_dep + "'";
            }
            if (Arrange_date != "")
            {
                strSql += " And a.now_date='" + Arrange_date + "'";
            }
            if (Prd_mo_from != "" && Prd_mo_to != "")
            {
                strSql += " And a.prd_mo>='" + Prd_mo_from + "' And a.prd_mo<='" + Prd_mo_to + "'";
            }
            if (Dep_group != "")
            {
                strSql += " And a.dep_group='" + Dep_group + "'";
            }
            if (Prd_item_from != "")
            {
                strSql += " And a.prd_item Like '" + "%" + Prd_item_from + "%'";
            }
            strSql += " Order By a.prd_dep,a.dep_group,a.arrange_seq,a.arrange_date";
            DataTable dt = sh.ExecuteSqlReturnDataTable(strSql);

            ReturnValue = cls.DataTableJsonReturnExcel(dt);//提取記錄,返回給表格

            context.Response.ContentType = "text/plain";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #23
0
        public void GetItem(HttpContext context)
        {
            string    paraa       = context.Request["paraa"];
            string    ReturnValue = string.Empty;
            clsPublic cls         = new clsPublic();
            string    mo_id       = "";
            //BasicInformationFacade basicInformationFacade = new BasicInformationFacade();   //实例化基础信息外观
            DataTable dt = new DataTable();

            //dt = basicInformationFacade.itemsQuery(); //根据查询条件获取结果
            if (paraa == "get_oc_a" || paraa == "get_oc_b")
            {
                mo_id = context.Request["mo"] != null ? context.Request["mo"] : "";
                string mo_group  = context.Request["mo_group"] != null ? context.Request["mo_group"] : "";
                string date_from = context.Request["date_from"] != null ? context.Request["date_from"] : "";
                string date_to   = context.Request["date_to"] != null ? context.Request["date_to"] : "";
                string ref_no    = context.Request["ref_no"] != null ? context.Request["ref_no"] : "";
                string item      = context.Request["item"] != null ? context.Request["item"] : "";
                string color     = context.Request["color"] != null ? context.Request["color"] : "";
                string size      = context.Request["size"] != null ? context.Request["size"] : "";
                string season    = context.Request["season"] != null ? context.Request["season"] : "";
                if (date_to != "")
                {
                    date_to = Convert.ToDateTime(date_to).AddDays(1).ToString("yyyy/MM/dd");
                }
                if (mo_id == "" && mo_group == "" && date_from == "" && date_to == "" && ref_no == "" && item == "" && color == "")
                {
                    mo_id = "ZZZZZZZZZ";
                }
                dt = Leyp.SQLServerDAL.Sales.Factory_New.SaOrderTestTraceDAL().getRecByMo(mo_group, date_from, date_to, mo_id, ref_no, item, color, size, season);
                if (dt.Rows.Count == 0)
                {
                    dt = Leyp.SQLServerDAL.Sales.Factory_New.SaOrderTestTraceDAL().getOcByMo(mo_id);
                }
                if (paraa == "get_oc_a")
                {
                    ReturnValue = cls.DataTableJsonReturnTextBox(dt);//提取記錄,返回給文本框
                }
                else
                {
                    ReturnValue = cls.DataTableJsonReturnTable(dt);//提取記錄,返回給表格
                }
            }
            else
            {
                if (paraa == "get_oclab")
                {
                    dt          = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().getOcLab();
                    ReturnValue = cls.DataTableJsonReturnList(dt);//提取記錄,返回給列表框的數據源
                }
                else
                {
                    if (paraa == "get_octest")
                    {
                        dt          = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().getOcTest();
                        ReturnValue = cls.DataTableJsonReturnList(dt);
                    }
                    else
                    {
                        if (paraa == "update")
                        {
                            ReturnValue = updateProcess(context);
                        }
                        else
                        {
                            if (paraa == "get_mogroup")
                            {
                                dt          = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().getMoGroup();
                                ReturnValue = cls.DataTableJsonReturnList(dt);
                            }
                            else
                            {
                                if (paraa == "update_invoice")
                                {
                                    ReturnValue = updateInvoiceProcess(context);
                                }
                                else
                                {
                                    if (paraa == "get_invoice_a" || paraa == "get_invoice_b")
                                    {
                                        string invoice_id = context.Request["parab"];
                                        if (invoice_id == null)
                                        {
                                            invoice_id = "";
                                        }
                                        mo_id = context.Request["mo_id"];
                                        if (mo_id == null)
                                        {
                                            mo_id = "";
                                        }
                                        string custcode = context.Request["custcode"];
                                        if (custcode == null)
                                        {
                                            custcode = "";
                                        }
                                        string brand = context.Request["brand"];
                                        if (brand == null)
                                        {
                                            brand = "";
                                        }
                                        string date_from = context.Request["date_from"];
                                        if (date_from == null || date_from == "")
                                        {
                                            date_from = "";
                                        }
                                        string mo_group = context.Request["mo_group"];
                                        if (mo_group == null || mo_group == "")
                                        {
                                            mo_group = "";
                                        }
                                        string date_to = context.Request["date_to"];
                                        if (date_to == null || date_to == "")
                                        {
                                            date_to = "";
                                        }
                                        else
                                        {
                                            date_to = Convert.ToDateTime(date_to).AddDays(1).ToString("yyyy/MM/dd");
                                        }
                                        if (invoice_id == "" && mo_id == "" && custcode == "" && mo_group == "" && brand == "" && date_from == "" && date_to == "")
                                        {
                                            mo_id     = "ZZZZZZZZZ";
                                            date_from = "1900/01/01";
                                            date_from = "1900/01/01";
                                        }
                                        dt = Leyp.SQLServerDAL.Sales.Factory_New.SaOrderTestTraceDAL().getInvoiceData(date_from, date_to, invoice_id, mo_id, custcode, mo_group, brand);
                                        if (dt.Rows.Count > 0)
                                        {
                                            if (paraa == "get_invoice_a")
                                            {
                                                ReturnValue = cls.DataTableJsonReturnTextBox(dt);//提取記錄,返回給文本框
                                            }
                                            else
                                            {
                                                ReturnValue = cls.DataTableJsonReturnExcel(dt);//提取記錄,返回給表格
                                            }
                                        }
                                        else
                                        {
                                            ReturnValue = "沒有找到記錄!";
                                        }
                                    }
                                    else
                                    {
                                        if (paraa == "get_curr")
                                        {
                                            dt          = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().getCurr();
                                            ReturnValue = cls.DataTableJsonReturnList(dt);
                                        }
                                        else
                                        {
                                            if (paraa == "delete_OrderTestInvoice")
                                            {
                                                ReturnValue = deleteInvoiceProcess(context);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            //clsPublic cls = new clsPublic();
            //ReturnValue = cls.DataTableJson(dt);
            //ReturnValue = DataTableJson(dt);
            context.Response.ContentType = "text/plain";
            //ReturnValue = "[{'dep_id':'101','dep_cdesc':'鈕 - 工程科'},{'dep_id':'102','dep_cdesc':'鈕 - 啤機'}]";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #24
0
        public void GetPlan(HttpContext context)
        {
            clsPublic cls = new clsPublic();
            BasePage  bp = new BasePage();
            string    ReturnValue = string.Empty;
            string    Prd_dep = "";
            string    Now_date = "";
            string    Prd_mo_from = "", Prd_mo_to = "";
            string    Prd_item_from = "";
            string    Mat_item_from = "";
            string    para          = context.Request["param"];

            if (para != null)
            {
                JArray ja = (JArray)JsonConvert.DeserializeObject(para);
                Prd_dep       = ja[0]["Prd_dep"].ToString().Trim();
                Now_date      = ja[0]["Now_date"].ToString().Trim();
                Prd_mo_from   = ja[0]["Prd_mo_from"].ToString().Trim();
                Prd_mo_to     = ja[0]["Prd_mo_to"].ToString().Trim();
                Prd_item_from = ja[0]["Prd_item_from"].ToString().Trim();
                Mat_item_from = ja[0]["Mat_item_from"].ToString().Trim();
            }
            else
            {
                Prd_dep       = context.Request["Prd_dep"] != null ? context.Request["Prd_dep"] : "";
                Now_date      = context.Request["Now_date"] != null ? context.Request["Now_date"] : "";
                Prd_mo_from   = context.Request["Prd_mo_from"] != null ? context.Request["Prd_mo_from"] : "";
                Prd_mo_to     = context.Request["Prd_mo_to"] != null ? context.Request["Prd_mo_to"] : "";
                Prd_item_from = context.Request["Prd_item_from"] != null ? context.Request["Prd_item_from"] : "";
                Mat_item_from = context.Request["Mat_item_from"] != null ? context.Request["Mat_item_from"] : "";
            }
            if (Prd_dep == "" && Now_date == "" && Prd_mo_from == "" && Prd_mo_to == "" && Prd_item_from == "" && Mat_item_from == "")
            {
                Prd_dep       = "ZZZ";
                Prd_mo_from   = "ZZZZZZZZZ";
                Prd_mo_to     = "ZZZZZZZZZ";
                Prd_item_from = "";
            }
            string strSql = "Select a.prd_seq,a.receive_date,a.prd_mo,a.prd_item,a.arrange_machine" +
                            ",a.prd_worker,a.delivery_date,a.arrange_qty,a.cpl_qty,a.not_cpl_qty,a.mat_item,a.arrange_id,a.prd_dep" +
                            ",a.arrange_date,a.now_date,a.wp_id" +
                            ",b.name As prd_item_cdesc" +
                            ",d.mat_item AS mat_item1,c.name As mat_item_cdesc,d.kg_qty_rate,Convert(float,d.kg_qty_rate) AS not_cpl_weg " +
                            " From product_arrange_jx a" +
                            " Left Join geo_it_goods b On a.prd_item=b.id" +
                            " Left Join bs_mat_rate d On a.prd_item=d.prd_item And a.wp_id=d.dep_id" +
                            " Left Join geo_it_goods c On d.mat_item=c.id" +
                            " Where a.arrange_id>=''";

            if (Prd_dep != "")
            {
                strSql += " And a.prd_dep='" + Prd_dep + "'";
            }
            if (Now_date != "")
            {
                strSql += " And a.now_date='" + Now_date + "'";
            }
            if (Prd_mo_from != "" && Prd_mo_to != "")
            {
                strSql += " And a.prd_mo>='" + Prd_mo_from + "' And a.prd_mo<='" + Prd_mo_to + "'";
            }
            if (Prd_item_from != "")
            {
                strSql += " And a.prd_item Like " + "'%" + Prd_item_from + "%'";
            }
            if (Mat_item_from != "")
            {
                strSql += " And d.mat_item Like " + "'%" + Mat_item_from + "%'";
            }
            strSql += " Order By a.prd_dep,a.arrange_seq";
            DataTable dt = sh.ExecuteSqlReturnDataTable(strSql);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow dr          = dt.Rows[i];
                double  kg_qty_rate = dr["kg_qty_rate"].ToString() != "" ? Convert.ToInt32(dr["kg_qty_rate"]) : 0;
                dr["not_cpl_weg"] = kg_qty_rate != 0 ? Math.Round(Convert.ToDouble(dr["not_cpl_qty"]) / Convert.ToDouble(dr["kg_qty_rate"]), 2) : 0;
            }
            ReturnValue = cls.DataTableJsonReturnExcel(dt);//提取記錄,返回給表格

            context.Response.ContentType = "text/plain";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #25
0
        public void GetItem(HttpContext context)
        {
            clsPublic cls = new clsPublic();
            BasePage  bp = new BasePage();
            string    ReturnValue = string.Empty;
            string    Prd_dep = "";
            string    Mo_group = "";
            string    Prd_mo_from = "", Prd_mo_to = "";
            string    Prd_item_from = "";
            string    Not_cpl_flag  = "";
            string    Cpl_flag      = "";
            string    para          = context.Request["param"];

            if (para != null)
            {
                JArray ja = (JArray)JsonConvert.DeserializeObject(para);
                Prd_dep       = ja[0]["Prd_dep"].ToString().Trim();
                Mo_group      = ja[0]["Mo_group"].ToString().Trim();
                Prd_mo_from   = ja[0]["Prd_mo_from"].ToString().Trim();
                Prd_mo_to     = ja[0]["Prd_mo_to"].ToString().Trim();
                Prd_item_from = ja[0]["Prd_item_from"].ToString().Trim();
                Cpl_flag      = ja[0]["Cpl_flag"].ToString().Trim();
                Not_cpl_flag  = ja[0]["Not_cpl_flag"].ToString().Trim();
            }
            else
            {
                Prd_dep       = context.Request["Prd_dep"] != null ? context.Request["Prd_dep"] : "";
                Mo_group      = context.Request["Mo_group"] != null ? context.Request["Mo_group"] : "";
                Prd_mo_from   = context.Request["Prd_mo_from"] != null ? context.Request["Prd_mo_from"] : "";
                Prd_mo_to     = context.Request["Prd_mo_to"] != null ? context.Request["Prd_mo_to"] : "";
                Prd_item_from = context.Request["Prd_item_from"] != null ? context.Request["Prd_item_from"] : "";
                Not_cpl_flag  = context.Request["Not_cpl_flag"] != null ? context.Request["Not_cpl_flag"] : "";
                Cpl_flag      = context.Request["Cpl_flag"] != null ? context.Request["Cpl_flag"] : "";
            }
            //if (Prd_dep == "" && Prd_mo_from == "" && Prd_mo_to == "" && Prd_item_from == "")
            //{

            //}
            //else
            //{
            string strSql = "Select a.prd_dep,a.prd_mo,a.prd_item,b.name AS prd_item_cdesc,(a.out_qty - a.in_qty) AS qty,(a.out_weg - a.in_weg) AS weg" +
                            ",a.out_date,a.in_date,a.cpl_flag" +
                            " FROM dgcf_pad.dbo.product_transfer_jx_summary a" +
                            " LEFT JOIN geo_it_goods b ON a.prd_item=b.id COLLATE chinese_taiwan_stroke_CI_AS" +
                            " WHERE a.prd_dep>=''";

            if (Prd_dep != "")
            {
                strSql += " AND a.prd_dep='" + Prd_dep + "'";
            }
            if (Mo_group != "")
            {
                strSql += " AND Substring(a.prd_mo,3,1)='" + Mo_group + "'";
            }
            if (Prd_mo_from != "" && Prd_mo_to != "")
            {
                strSql += " AND a.prd_mo>='" + Prd_mo_from + "' AND a.prd_mo<='" + Prd_mo_to + "'";
            }
            if (Prd_item_from != "")
            {
                strSql += " AND a.prd_item Like '" + "%" + Prd_item_from + "%" + "'";
            }
            if (Not_cpl_flag == "1")
            {
                strSql += " AND ((a.out_qty - a.in_qty ) <> 0 OR (a.out_weg - a.in_weg <> 0 ))";
            }
            if (Cpl_flag == "1")
            {
                strSql += " AND a.Cpl_flag<>'" + Cpl_flag + "'";
            }
            strSql += " ORDER BY a.prd_dep,a.prd_item,a.prd_mo";
            DataTable dt = SQLHelper.ExecuteSqlReturnDataTable(strSql);


            ReturnValue = cls.DataTableJsonReturnExcel(dt);    //提取記錄,返回給表格
            //}
            context.Response.ContentType = "text/plain";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #26
0
        public void GetItem(HttpContext context)
        {
            clsPublic cls         = new clsPublic();
            BasePage  bp          = new BasePage();
            string    ReturnValue = string.Empty;
            string    Dep_id      = "";
            string    Mat_item    = "";
            string    Prd_item    = "";
            string    para        = context.Request["param"];
            string    parab       = context.Request["parab"];

            if (para != null)
            {
                JArray ja = (JArray)JsonConvert.DeserializeObject(para);
                Dep_id   = ja[0]["Dep_id"].ToString().Trim();
                Prd_item = ja[0]["Prd_item"].ToString().Trim();
                Mat_item = ja[0]["Mat_item"].ToString().Trim();
            }
            else
            {
                Dep_id   = context.Request["Dep_id"] != null ? context.Request["Dep_id"] : "";
                Prd_item = context.Request["Prd_item"] != null ? context.Request["Prd_item"] : "";
                Mat_item = context.Request["Mat_item"] != null ? context.Request["Mat_item"] : "";
            }
            if (Dep_id == "" && Prd_item == "" && Mat_item == "")
            {
                Dep_id   = "J99";
                Prd_item = "";
                Mat_item = "";
            }
            string strSql = "Select a.*,b.name AS prd_item_cdesc,c.name AS mat_item_cdesc" +
                            " From bs_mat_rate a " +
                            " Left Join geo_it_goods b ON a.prd_item=b.id" +
                            " Left Join geo_it_goods c ON a.mat_item=c.id" +
                            " Where a.prd_item>=''";

            if (Dep_id != "")
            {
                strSql += " And a.dep_id = '" + Dep_id + "'";
            }
            if (Prd_item != "")
            {
                strSql += " And a.Prd_item Like '" + "%" + Prd_item + "%" + "'";
            }
            if (Mat_item != "")
            {
                strSql += " And a.mat_item Like '" + "%" + Mat_item + "%" + "'";
            }
            strSql += " Order By a.dep_id,a.prd_item,a.mat_item";
            DataTable dt = SQLHelper.ExecuteSqlReturnDataTable(strSql);

            if (parab == "list")
            {
                ReturnValue = cls.DataTableJsonReturnExcel(dt);
            }
            else
            {
                ReturnValue = cls.DataTableJsonReturnExcel(dt);//提取記錄,返回給表格
            }
            context.Response.ContentType = "text/plain";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #27
0
        public void GetItemDetails(HttpContext context)
        {
            clsPublic cls = new clsPublic();
            BasePage  bp = new BasePage();
            string    ReturnValue = string.Empty;
            string    Prd_dep = "";
            string    Mo_group = "";
            string    Prd_mo_from = "", Prd_mo_to = "";
            string    Prd_item_from = "";
            string    Date_from = "", Date_to = "";
            string    Transfer_flag = "";
            string    para          = context.Request["param"];

            if (para != null)
            {
                JArray ja = (JArray)JsonConvert.DeserializeObject(para);
                Prd_dep       = ja[0]["Prd_dep"].ToString().Trim();
                Prd_mo_from   = ja[0]["Prd_mo_from"].ToString().Trim();
                Prd_mo_to     = ja[0]["Prd_mo_to"].ToString().Trim();
                Mo_group      = ja[0]["Mo_group"].ToString().Trim();
                Prd_item_from = ja[0]["Prd_item_from"].ToString().Trim();
                Date_from     = ja[0]["Date_from"].ToString().Trim();
                Date_to       = ja[0]["Date_to"].ToString().Trim();
                Transfer_flag = ja[0]["Transfer_flag"].ToString().Trim();
            }
            else
            {
                Prd_dep       = context.Request["Prd_dep"] != null ? context.Request["Prd_dep"] : "";
                Prd_mo_from   = context.Request["Prd_mo_from"] != null ? context.Request["Prd_mo_from"] : "";
                Prd_mo_to     = context.Request["Prd_mo_to"] != null ? context.Request["Prd_mo_to"] : "";
                Mo_group      = context.Request["Mo_group"] != null ? context.Request["Mo_group"] : "";
                Prd_item_from = context.Request["Prd_item_from"] != null ? context.Request["Prd_item_from"] : "";
                Date_from     = context.Request["Date_from"] != null ? context.Request["Date_from"] : "";
                Date_to       = context.Request["Date_to"] != null ? context.Request["Date_to"] : "";
                Transfer_flag = context.Request["Transfer_flag"] != null ? context.Request["Transfer_flag"] : "";
            }
            if (Prd_dep == "" && Prd_mo_from == "" && Prd_mo_to == "" && Prd_item_from == "" && Date_from == "" & Date_to == "")
            {
            }
            else
            {
                string strSql = "Select a.prd_dep,d.dep_cdesc AS prd_dep_cdesc,a.prd_mo,a.prd_item,b.name AS prd_item_cdesc" +
                                ",a.transfer_qty,a.transfer_weg,a.wip_id" +
                                ",a.transfer_date,c.flag_desc,a.to_dep,e.dep_cdesc AS to_dep_cdesc " +
                                " FROM dgcf_pad.dbo.product_transfer_jx_details a" +
                                " LEFT JOIN geo_it_goods b ON a.prd_item=b.id COLLATE chinese_taiwan_stroke_CI_AS" +
                                " LEFT JOIN bs_flag_desc c ON a.transfer_flag=c.flag_id COLLATE chinese_taiwan_stroke_CI_AS" +
                                " LEFT JOIN bs_dep d ON a.wip_id=d.dep_id COLLATE chinese_taiwan_stroke_CI_AS" +
                                " LEFT JOIN bs_dep e ON a.to_dep=e.dep_id COLLATE chinese_taiwan_stroke_CI_AS" +
                                " WHERE c.doc_type='goods_transfer_jx'";
                if (Prd_dep != "")
                {
                    strSql += " AND a.prd_dep='" + Prd_dep + "'";
                }
                if (Mo_group != "")
                {
                    strSql += " AND Substring(a.prd_mo,3,1)='" + Mo_group + "'";
                }
                if (Prd_mo_from != "" && Prd_mo_to != "")
                {
                    strSql += " AND a.prd_mo>='" + Prd_mo_from + "' AND a.prd_mo<='" + Prd_mo_to + "'";
                }
                if (Prd_item_from != "")
                {
                    strSql += " AND a.prd_item Like '" + "%" + Prd_item_from + "%" + "'";
                }
                if (Date_from != "" && Date_to != "")
                {
                    strSql += " AND a.Transfer_date>='" + Date_from + "' AND a.Transfer_date<='" + Date_to + "'";
                }
                if (Transfer_flag.Trim() == "0" || Transfer_flag.Trim() == "1")
                {
                    strSql += " AND a.Transfer_flag='" + Transfer_flag + "'";
                }
                strSql += " ORDER BY a.prd_dep,a.Transfer_flag,a.transfer_date,a.prd_item,a.prd_mo";
                DataTable dt = SQLHelper.ExecuteSqlReturnDataTable(strSql);


                ReturnValue = cls.DataTableJsonReturnExcel(dt);//提取記錄,返回給表格
            }
            context.Response.ContentType = "text/plain";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #28
0
        public void getData(HttpContext context)
        {
            clsPublic cls = new clsPublic();
            string    ReturnValue = string.Empty;
            string    remote_db = DBUtility.remote_db;
            string    within_code = DBUtility.within_code;
            BasePage  bp = new BasePage();
            string    userId = bp.getUserName();
            string    moGroup = "";
            string    dateFrom = "", dateTo = "";
            string    orderDateFrom = "", orderDateTo = "";
            string    productMoFrom = "", productMoTo = "";
            string    brandFrom = "", brandTo = "";
            string    ownFrom = "", ownTo = "";
            string    custFrom = "", custTo = "";
            int       sourceType = 1;
            string    isAPart    = "";
            string    isComplete = "";
            string    createBy   = "";
            string    para       = context.Request["param"];

            if (para != null)
            {
                JArray ja = (JArray)JsonConvert.DeserializeObject(para);
                moGroup       = ja[0]["MoGroup"].ToString().Trim();
                createBy      = ja[0]["CreateBy"].ToString().Trim();
                dateFrom      = ja[0]["DateFrom"].ToString().Trim();
                dateTo        = ja[0]["DateTo"].ToString().Trim();
                orderDateFrom = ja[0]["OrderDateFrom"].ToString().Trim();
                orderDateTo   = ja[0]["OrderDateTo"].ToString().Trim();
                productMoFrom = ja[0]["MoFrom"].ToString().Trim();
                productMoTo   = ja[0]["MoTo"].ToString().Trim();
                brandFrom     = ja[0]["BrandFrom"].ToString().Trim();
                brandTo       = ja[0]["BrandTo"].ToString().Trim();
                custFrom      = ja[0]["CustFrom"].ToString().Trim();
                custTo        = ja[0]["CustTo"].ToString().Trim();
                ownFrom       = ja[0]["OwnFrom"].ToString().Trim();
                ownTo         = ja[0]["OwnTo"].ToString().Trim();
                sourceType    = Convert.ToInt32(ja[0]["SourceType"].ToString());
                isAPart       = ja[0]["IsAPart"].ToString().Trim();
                isComplete    = ja[0]["IsComplete"].ToString().Trim();
            }
            else
            {
                moGroup       = context.Request["MoGroup"] != null ? context.Request["MoGroup"] : "";
                createBy      = context.Request["CreateBy"] != null ? context.Request["CreateBy"] : "";
                dateFrom      = context.Request["DateFrom"] != null ? context.Request["DateFrom"] : "";
                dateTo        = context.Request["DateTo"] != null ? context.Request["DateTo"] : "";
                orderDateFrom = context.Request["OrderDateFrom"] != null ? context.Request["OrderDateFrom"] : "";
                orderDateTo   = context.Request["OrderDateTo"] != null ? context.Request["OrderDateTo"] : "";
                productMoFrom = context.Request["MoFrom"] != null ? context.Request["MoFrom"] : "";
                productMoTo   = context.Request["MoTo"] != null ? context.Request["MoTo"] : "";
                brandFrom     = context.Request["BrandFrom"] != null ? context.Request["BrandFrom"] : "";
                brandTo       = context.Request["BrandTo"] != null ? context.Request["BrandTo"] : "";
                custFrom      = context.Request["CustFrom"] != null ? context.Request["CustFrom"] : "";
                custTo        = context.Request["CustTo"] != null ? context.Request["CustTo"] : "";
                ownFrom       = context.Request["OwnFrom"] != null ? context.Request["OwnFrom"] : "";
                ownTo         = context.Request["OwnTo"] != null ? context.Request["OwnTo"] : "";
                sourceType    = context.Request["SourceType"] != null?Convert.ToInt32(context.Request["SourceType"]) : 1;

                isAPart    = context.Request["IsAPart"] != null ? context.Request["IsAPart"] : "";
                isComplete = context.Request["IsComplete"] != null ? context.Request["IsComplete"] : "";
            }
            if (moGroup == "" && createBy == "" && dateFrom == "" && orderDateFrom == "" && productMoFrom == "" && brandFrom == "" && custFrom == "" && ownFrom == "")
            {
                productMoFrom = "ZZZZZZZZZZ";
                productMoTo   = "ZZZZZZZZZZ";
            }
            SqlParameter[] parameters = { new SqlParameter("@source_type", sourceType)
                                          ,                                new SqlParameter("@user_id",   userId)
                                          ,                                new SqlParameter("@cp_state",  isComplete)
                                          ,                                new SqlParameter("@mo_group",  moGroup)
                                          ,                                new SqlParameter("@crdat1",    dateFrom),      new SqlParameter("@crdat2", dateTo)
                                          ,                                new SqlParameter("@crby",      createBy)
                                          ,                                new SqlParameter("@dat1",      orderDateFrom), new SqlParameter("@dat2", orderDateTo)
                                          ,                                new SqlParameter("@mo1",       productMoFrom), new SqlParameter("@mo2", productMoTo)
                                          ,                                new SqlParameter("@brand1",    brandFrom),     new SqlParameter("@brand2", brandTo)
                                          ,                                new SqlParameter("@cust1",     custFrom),      new SqlParameter("@cust2", custTo)
                                          ,                                new SqlParameter("@own1",      ownFrom),       new SqlParameter("@own2", ownTo)
                                          ,                                new SqlParameter("@showapart", isAPart) };

            DataTable dtOc = SQLHelper.ExecuteProcedureRetrunDataTable("usp_GetOcStatus", parameters);

            ReturnValue = cls.DataTableJsonReturnExcel(dtOc);//提取記錄,返回給表格
            //}
            context.Response.ContentType = "text/plain";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #29
0
        public void getData(HttpContext context)
        {
            clsPublic cls = new clsPublic();
            string    ReturnValue = string.Empty;
            string    remote_db = DBUtility.remote_db;
            string    within_code = DBUtility.within_code;
            string    dateFrom = "", dateTo = "";
            string    productMoFrom = "", productMoTo = "";
            string    invFrom = "", invTo = "";
            string    para = context.Request["param"];

            if (para != null)
            {
                JArray ja = (JArray)JsonConvert.DeserializeObject(para);
                dateFrom      = ja[0]["Date_from"].ToString().Trim();
                dateTo        = ja[0]["Date_to"].ToString().Trim();
                productMoFrom = ja[0]["Prd_mo_from"].ToString().Trim();
                productMoTo   = ja[0]["Prd_mo_to"].ToString().Trim();
                invFrom       = ja[0]["invFrom"].ToString().Trim();
                invTo         = ja[0]["invTo"].ToString().Trim();
            }
            else
            {
                dateFrom      = context.Request["Date_from"] != null ? context.Request["Date_from"] : "";
                dateTo        = context.Request["Date_to"] != null ? context.Request["Date_to"] : "";
                productMoFrom = context.Request["Prd_mo_from"] != null ? context.Request["Prd_mo_from"] : "";
                productMoTo   = context.Request["Prd_mo_to"] != null ? context.Request["Prd_mo_to"] : "";
                invFrom       = context.Request["invFrom"] != null ? context.Request["invFrom"] : "";
                invTo         = context.Request["invTo"] != null ? context.Request["invTo"] : "";
            }
            string strSql = "Select b.mo_id,a.id,a.invoice_no,Convert(Varchar(20),a.invoice_date,111) AS invoice_date,c.name AS goods_cname " +
                            ",b.issues_unit,Convert(INT,b.issues_qty) AS issues_qty,d.id AS order_id,d.unit_price,d.p_unit,f.rate" +
                            ",Round((b.issues_qty/f.rate)*Convert(float,d.unit_price),2) AS order_amt" +
                            ",e.linkman,d.table_head,e.m_id" +
                            " From " + remote_db + "so_issues_mostly a" +
                            " Inner Join " + remote_db + "so_issues_details b On a.within_code=b.within_code And a.id=b.id" +
                            " Inner Join " + remote_db + "it_goods c On b.within_code=c.within_code And b.goods_id=c.id" +
                            " Inner Join " + remote_db + "so_order_details d On b.within_code=d.within_code And b.mo_id=d.mo_id" +
                            " Inner Join " + remote_db + "so_order_manage e On d.within_code=e.within_code And d.id=e.id And d.ver=e.ver" +
                            " Inner Join " + remote_db + "it_coding f On d.within_code=f.within_code And d.p_unit=f.unit_code And b.issues_unit=f.basic_unit" +
                            " Where a.within_code='" + within_code + "' And f.id='*'";

            if (dateFrom == "" && invFrom == "" && productMoFrom == "")
            {
                invFrom = "INV999999999";
                invTo   = "INV999999999";
            }
            if (dateFrom != "" && dateTo != "")
            {
                dateTo  = Convert.ToDateTime(dateTo).AddDays(1).ToString("yyyy/MM/dd");
                strSql += " And a.invoice_date>='" + dateFrom + "' And a.invoice_date<'" + dateTo + "'";
            }
            if (productMoFrom != "" && productMoTo != "")
            {
                strSql += " And b.mo_id>='" + productMoFrom + "' And b.mo_id<='" + productMoTo + "'";
            }
            if (invFrom != "" && invTo != "")
            {
                strSql += " And a.invoice_no>='" + invFrom + "' And a.invoice_no<='" + invTo + "'";
            }
            strSql += " Order By a.invoice_no,a.invoice_date,b.mo_id";
            DataTable dt = SQLHelper.ExecuteSqlReturnDataTable(strSql);


            ReturnValue = cls.DataTableJsonReturnExcel(dt);//提取記錄,返回給表格
            //}
            context.Response.ContentType = "text/plain";
            context.Response.Write(ReturnValue);
            context.Response.End();
        }
Пример #30
0
        public void GetItem(HttpContext context)
        {
            string paraa = context.Request["paraa"];
            string parab = context.Request["parab"];
            string para = context.Request["param"];
            string id = "", name = "";
            string search_val = "";

            if (para != null)
            {
                JArray ja = (JArray)JsonConvert.DeserializeObject(para);

                if (paraa == "get_prdtype")
                {
                    search_val = ja[0]["search_val"].ToString().Trim();
                }
                else
                {
                    id   = ja[0]["id"].ToString().Trim();
                    name = ja[0]["name"].ToString().Trim();
                }
            }
            string ReturnValue = string.Empty;
            //BasicInformationFacade basicInformationFacade = new BasicInformationFacade();   //实例化基础信息外观
            DataTable dt = new DataTable();

            //dt = basicInformationFacade.itemsQuery(); //根据查询条件获取结果
            switch (paraa)
            {
            case "sa_order_trace":
                dt = Leyp.SQLServerDAL.Sales.Factory_New.SalesQueryPublicDAL().getCpFlag();
                break;

            case "pd_mo_plan_dep":
                dt = Leyp.SQLServerDAL.Sales.Factory_New.SalesQueryPublicDAL().getDep();
                break;

            case "pd_mo_plan_work_type":
                dt = Leyp.SQLServerDAL.Sales.Factory_New.SalesQueryPublicDAL().getWork_type();
                break;

            case "get_oclab":
                dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().getOcLab();
                break;

            case "get_mogroup":
                dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().getMoGroup();
                break;

            case "get_ocmogroup":
                dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().getOcMoGroup();
                break;

            case "getSa_Oc_NoCompleteOc":
                dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().getSa_Oc_NoCompleteOc();
                break;

            case "get_season":
                dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().get_season();
                break;

            case "get_mogroup_para":
                dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().getMoGroup_para(id);
                break;

            case "get_matdata":
                search_val = context.Request["search_val"] != null ? context.Request["search_val"] : "";
                dt         = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().get_MatData(search_val);
                break;

            case "get_unit":
                dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().get_unit();
                break;

            case "get_prdtype":
                dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().get_PrdType(search_val);
                break;

            case "get_funcgroup":
                dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().get_funcgroup();
                break;

            case "get_salesgroup":
                dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().get_salesgroup();
                break;

            case "get_lang":
                dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().get_lang("LANG");
                break;

            case "get_userstate":
                dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().get_lang("user_state");
                break;

            case "get_usertype":
                dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().get_lang("user_type");
                break;

            case "get_geousergroup":
                dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().get_geousergroup();
                break;

            case "get_transfer_flag":
                dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().get_lang("st_jx_stransfer_flag");
                break;

            case "get_jx_dep":
                dt = Leyp.SQLServerDAL.Sales.Factory_New.SalesQueryPublicDAL().getJxDep();
                break;

            case "goods_transfer_jx":
                dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().get_docflag("goods_transfer_jx");
                break;

            case "set_polo_order_trace":
                dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().get_docflag("set_polo_order_trace");
                break;

            case "get_order_complete_flag":
                dt = Leyp.SQLServerDAL.Factory_New.BaseDataDAL().getMoStatusFlag();
                break;
            }


            clsPublic cls = new clsPublic();

            if (parab == "list")
            {
                ReturnValue = cls.DataTableJsonReturnList(dt);
            }
            else
            {
                if (parab == "table")
                {
                    ReturnValue = cls.DataTableJsonReturnExcel(dt);
                }
                else
                {
                    ReturnValue = cls.DataTableJsonReturnTextBox(dt);
                }
            }
            context.Response.ContentType = "text/plain";
            //context.Response.ContentType = "application/json";
            context.Response.Write(ReturnValue);
            context.Response.End();
            //return ReturnValue;
        }