Exemplo n.º 1
0
        private void GetSKUCheck()
        { 
            string VipId 
                = this.dtList.Rows[0]["VipId"].ToString();
            string SKU
                = this.dtList.Rows[0]["SKU"].ToString();
            string DepotId
                = base.m_hzyMessage.User_Name_CN.Split('_')[0];

            DataTable dtChk = new DataTable();
            DataTable dtRst = new DataTable();

                dtRst.Columns.Add("Result");
                dtRst.Columns.Add("Msg");
                dtRst.Columns.Add("Date");

            //数据清洗
            VipId = FilterSpecial(VipId);
            SKU = FilterSpecial(SKU);
            bool b = Convert.ToChar(DepotId.Substring(0, 1)) <= 'Z';


            if (b)
            {
                DBHandle DBH = new DBHandle("CUSF22");
                //调用存储过程
                dtChk = DBH.GetDataBySP(
                    "dbo.SP_AftermarketRepairs_Check",
                    new object[3] { "clothingid", "depotid", "vipcode" },
                    new object[3] { SKU, DepotId, VipId });
                if (dtChk != null)
                {
                    if (dtChk.Rows.Count > 0)
                    {
                        string result = dtChk.Rows[0]["Result"].ToString();
                        string[] strRst = result.Split(',');

                        //account strRst:
                        //strRst[0] = 0,无经营权,strRst[0] = 1,有经营权
                        //strRst[1] = 0,顾客未购买,strRst[1] = 1,顾客有购买

                        //logic:
                        //1.判断strRst[0]=0,直接返回结果
                        //2.strRst[0] = 1,继续判断顾客
                        //3.strRst[1] = 0,返回无购买记录
                        //4.strRst[1] = 1,返回购买记录

                        if (Int32.Parse(strRst[0]) == 0)
                        {
                            DataRow dr = dtRst.NewRow();
                            dtRst.Rows[0]["Result"] = false;
                            dtRst.Rows[0]["Msg"] = "此登陆帐号,无该品牌经营权。请更换相应帐号!";
                            dtRst.Rows[0]["Date"] = "";
                        }
                        else
                        {
                            if (Int32.Parse(strRst[1]) == 0)
                            {
                                DataRow dr = dtRst.NewRow();
                                dr["Result"] = false;
                                dr["Msg"] = "该顾客未购买此款衣服,请确认款号是否正确!";
                                dr["Date"] = "";
                                dtRst.Rows.Add(dr);
                            }
                            else
                            {
                                DataRow dr = dtRst.NewRow();
                                dr["Result"] = true;
                                dr["Msg"] = "验证通过,可以维修.";
                                dr["Date"] = dtChk.Rows[0]["sure_date"];
                                dtRst.Rows.Add(dr);
                            };
                        };
                    }
                    else
                    {
                        DataRow dr = dtRst.NewRow();
                        dr["Result"] = false;
                        dr["Msg"] = "验证失败,请再次尝试!";
                        dr["Date"] = "";
                        dtRst.Rows.Add(dr);
                    };
                }
                else
                {
                    DataRow dr = dtRst.NewRow();
                    dr["Result"] = false;
                    dr["Msg"] = "验证失败,请再次尝试!";
                    dr["Date"] = "";
                    dtRst.Rows.Add(dr);
                };
            }
            else
            {
                DataRow dr = dtRst.NewRow();
                dr["Result"] = false;
                dr["Msg"] = "只有店铺才可以使用此功能!";
                dr["Date"] = "";
                dtRst.Rows.Add(dr);
            };
            

            this.ds_Return.Tables.Add(dtRst);
        }
Exemplo n.º 2
0
        private void NewFixJudge()
        {
            DataRow drRow = this.dt_Return.NewRow();
            //获取维修单号
            string wxno 
                = this.dtList.Rows[0]["WXNo"].ToString();
            string warehouse
                = this.dtList.Rows[0]["Warehouse"].ToString();

            wxno = FilterSpecial(wxno);
            warehouse = FilterSpecial(warehouse);

            string selectMain
                = @"SELECT [ID] 
                        ,[WXNo]
                        ,[DepotId]
                        ,[CreateUser]
                        ,[SKU]
                        ,[Status]
                        ,[WarehouseNo]
                        ,[ModifyTime]
                        ,[ModifyUser]
                    FROM [dbo].[SPWX_Main] WITH(NOLOCK)
                    WHERE [Status] = '20' AND [WXNo] = @Param0 ";

            //创建连接对象
            DBHandle dbh = new DBHandle("SPWX");
            
            //获取主表状态
            DataTable dtMain 
                = dbh.GetData(selectMain,new object[]{wxno});

            //判断有无初判数据
            if (dtMain.Rows.Count > 0)
            {
                //获取交易表表头
                DataTable dtHist = dbh.GetTabHead("[dbo].[SPWX_Hist]");

                DataRow dr = dtHist.NewRow();
                dr["WXNo"] = wxno;
                dr["BeforeStatus"] = dtMain.Rows[0]["Status"].ToString();
                dr["AfterStatus"] = "25";
                dr["Content"] = "操作内容:完成初判";
                dr["ModifyUser"] = base.m_hzyMessage.User_Name;

                dtHist.Rows.Add(dr);
                //修改主表状态,修改人
                dtMain.Rows[0]["Status"] = "25";
                dtMain.Rows[0]["ModifyUser"] = base.m_hzyMessage.User_Name;
                dtMain.Rows[0]["ModifyTime"] = timeNow.ToString();

                //获取维修价格和时间
                string value
                    = this.dtList.Rows[0]["FirstPhen"].ToString();
                value = FilterSpecial(value);

                DataTable dtMD = GetMoneyDay(value);

                //新插入表
                this.dtList.Columns.Add("CreateUser");
                this.dtList.Columns.Add("ModifyUser");


                this.dtList.Rows[0]["FixNeedTime"]
                    = dtMD.Rows[0]["Day"].ToString();
                this.dtList.Rows[0]["FixNeedMoney"]
                    = dtMD.Rows[0]["Money"].ToString();
                this.dtList.Rows[0]["CreateUser"]
                        = base.m_hzyMessage.User_Name;
                this.dtList.Rows[0]["ModifyUser"]
                        = base.m_hzyMessage.User_Name;

                //调用退仓单

                if (warehouse.Length > 0)
                {
                    string DepotId = dtMain.Rows[0]["DepotId"].ToString();
                    string CreateUser = dtMain.Rows[0]["CreateUser"].ToString();
                    string sku = dtMain.Rows[0]["SKU"].ToString();
                    string sendUser = base.m_hzyMessage.User_Name;
                    string WarehouseNo = dtMain.Rows[0]["WarehouseNo"].ToString();

                    DBHandle dbhGP = new DBHandle("F22GP");

                    object[] paramObj = new object[4];

                    object[] paramVal = new object[4];

                    paramObj[0] = SParam.InputFormat;
                    paramObj[1] = SParam.OutputFormat;
                    paramObj[2] = SParam.OutputContentType;
                    paramObj[3] = SParam.ConditionStr;

                    paramVal[0] = "AML";
                    paramVal[1] = "DB";
                    paramVal[2] = "RS";
                    paramVal[3] = @"【操作类型,NEW】【实体,发货】
                        【新增内容,发货店铺ID,收货店铺ID,装箱号,款号,款式编号,颜色,尺码,退货数量,成本,
                            原价,现价,结算价,折扣,登记人,发货操作员,收货操作员】
                        【条件内容,《N》发货店铺ID,《N》收货店铺ID,《N》装箱号,《N》款号,《N》款式编号,
                            《N》颜色,《N》尺码,《N》退货数量,《N》成本,《N》原价,《N》现价,《N》结算价,《N》折扣,
                            《N》登记人,《N》发货操作员,《N》收货操作员 】
                        【《N》维修单号," + wxno + "】【《N》发货店铺ID," + DepotId + "】【《N》收货店铺ID," + WarehouseNo + @"】
                        【《N》装箱号," + sendUser + "】【《N》款号," + sku + @"】【《N》款式编号,】【《N》颜色,】
                        【《N》尺码,】【《N》退货数量,1】【《N》成本,0】【《N》原价,0】【《N》现价,0】【《N》结算价,0】
                        【《N》折扣,0】【《N》登记人," + sendUser + "】【《N》发货操作员," + sendUser + "】【《N》收货操作员,】";
                    DataTable dtRtn
                        = dbhGP.GetDataBySP("[API_Bill].[Thd_Info]", paramObj, paramVal);

                    if (dtRtn != null)
                    {
                        if (dtRtn.Rows.Count > 0)
                        {
                            string result = dtRtn.Rows[0]["FLAG"].ToString();

                            if (result.ToUpper() == "TRUE")
                            {
                                string returnNo = dtRtn.Rows[0]["outindentid"].ToString();
                                this.dtList.Columns.Add("ReturnNo");
                                this.dtList.Rows[0]["ReturnNo"] = returnNo;
                                //调用收货的过程
                                paramVal[3] = @"【操作类型,NEW】【实体,收货】
                                    【新增内容,退货单号,发货店铺ID,收货店铺ID,装箱号,款号,款式编号,颜色,尺码,退货数量,成本,
                                        原价,现价,结算价,折扣,登记人,发货操作员,收货操作员】
                                    【条件内容,《N》退货单号,《N》发货店铺ID,《N》收货店铺ID,《N》装箱号,《N》款号,《N》款式编号,
                                        《N》颜色,《N》尺码,《N》退货数量,《N》成本,《N》原价,《N》现价,《N》结算价,《N》折扣,《N》登记人,
                                        《N》发货操作员,《N》收货操作员 】【《N》退货单号," + returnNo + "】【《N》发货店铺ID," + DepotId + @"】
                                        【《N》收货店铺ID," + WarehouseNo + "】【《N》装箱号," + sendUser + "】【《N》款号," + sku + @"】【《N》款式编号,】
                                        【《N》颜色,】【《N》尺码,】【《N》退货数量,1】【《N》成本,0】【《N》原价,0】【《N》现价,0】
                                        【《N》结算价,0】【《N》折扣,0】【《N》登记人," + CreateUser + "】【《N》发货操作员,】【《N》收货操作员," + sendUser + "】";
                                DataTable dtClt
                                    = dbhGP.GetDataBySP("[API_Bill].[Thd_Info]", paramObj, paramVal);
                                if (dtClt != null)
                                {
                                    if (dtClt.Rows.Count > 0)
                                    {
                                        if (dtClt.Rows[0]["FLAG"].ToString().ToUpper() == "TRUE")
                                        {
                                            DataTable dtHead = this.dtList.Copy();
                                            dtHead.TableName = "[dbo].[SPWX_Headquarters]";
                                            dtMain.TableName = "[dbo].[SPWX_Main]";
                                            dtHist.TableName = "[dbo].[SPWX_Hist]";

                                            DataSet ds = new DataSet();
                                            ds.Tables.Add(dtHead);
                                            ds.Tables.Add(dtMain);
                                            ds.Tables.Add(dtHist);

                                            this.bRst = dbh.UpdateDB("ID", ds);

                                            if (this.bRst)
                                            {
                                                drRow["result"] = true;
                                                drRow["message"] = "提交成功";
                                            }
                                            else
                                            {
                                                drRow["result"] = false;
                                                drRow["message"] = "提交失败";
                                            };
                                        }
                                        else
                                        {
                                            string msg = dtRtn.Rows[0]["message"].ToString();
                                            drRow["result"] = false;
                                            drRow["message"] = msg;
                                        };
                                    }
                                    else
                                    {
                                        drRow["result"] = false;
                                        drRow["message"] = "收货单生成失败,请联系信息管理部。";
                                    };
                                }
                                else
                                {
                                    drRow["result"] = false;
                                    drRow["message"] = "收货单生成失败,请联系信息管理部。";
                                };

                            }
                            else
                            {
                                string msg = dtRtn.Rows[0]["message"].ToString();
                                drRow["result"] = false;
                                drRow["message"] = msg;
                            };
                        }
                        else
                        {
                            drRow["result"] = false;
                            drRow["message"] = "退货单生成失败,请联系信息管理部。";
                        };
                    }
                    else
                    {
                        drRow["result"] = false;
                        drRow["message"] = "退货单生成失败,请联系信息管理部。";
                    };
                }
                else
                {
                    DataTable dtHead = this.dtList.Copy();
                    dtHead.TableName = "[dbo].[SPWX_Headquarters]";
                    dtMain.TableName = "[dbo].[SPWX_Main]";
                    dtHist.TableName = "[dbo].[SPWX_Hist]";

                    DataSet ds = new DataSet();
                    ds.Tables.Add(dtHead);
                    ds.Tables.Add(dtMain);
                    ds.Tables.Add(dtHist);

                    this.bRst = dbh.UpdateDB("ID", ds);

                    if (this.bRst)
                    {
                        drRow["result"] = true;
                        drRow["message"] = "提交成功";
                    }
                    else
                    {
                        drRow["result"] = false;
                        drRow["message"] = "提交失败";
                    };
                };
            }
            else 
            {
                drRow["result"] = false;
                drRow["message"] = "在初判表中已经无法找到该维修单号,请确认。";
            };
            
            this.dt_Return.Rows.Add(drRow);

            this.ds_Return.Tables.Add(this.dt_Return);
        }
Exemplo n.º 3
0
        private DataTable GetSupplierInfo(string SKU)
        {
            string sku = SKU;
            sku = FilterSpecial(sku);

            DBHandle dbh = new DBHandle("F22GP");

            object[] paramObj = new object[4];

            object[] paramVal = new object[4];

            paramObj[0] = SParam.InputFormat;
            paramObj[1] = SParam.OutputFormat;
            paramObj[2] = SParam.OutputContentType;
            paramObj[3] = SParam.ConditionStr;

            paramVal[0] = "AML";
            paramVal[1] = "DB";
            paramVal[2] = "RS";
            paramVal[3] = "【操作类型,GET】【实体,J_Supplier】"
                +"【返回内容,供应商ID,供应商简称,供应商全称】"
                +"【条件内容,《W》款号】【《W》款号,"+sku+"】";

            //used "[API_Product].[GetProdInfo]" sp in 200.120.
            DataTable dt 
                = dbh.GetDataBySP("[API_Product].[GetProdInfo]", paramObj, paramVal);

            return dt;
        }