Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SiteHelper.GetPageUrlpower("Storage/CheckStock.aspx");
            if (Session["PowerRead"].ToString() != "1")
            {
                SiteHelper.NOPowerMessage();
            }
            if (!Page.IsPostBack)
            {
                string    act  = Request["act"];
                SqlHelper conn = LocalSqlHelper.WH;
                switch (act)
                {
                case "truncate":    //清空
                    string sql = "delete from Tb_check_input where main_id=" + Request["id"];
                    conn.Execute(sql);
                    JSHelper.WriteScript("alert('已清空');location.href='CheckStock.aspx';");
                    break;

                case "drop":    //删除
                    Response.Write("开发进行中...");
                    break;

                default:
                    BindMemberList(SiteHelper.getPage(), getWhere());
                    break;
                }
            }
        }
Exemple #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string RoleName = string.Empty;
            string RoleDes  = string.Empty;

            RoleName = TextRoleName.Text;
            RoleDes  = TextRoleDes.Text;
            isAgent  = Convert.ToInt32(Request["isAgent"]);
            string doSql = string.Empty;

            if (GroupId == 0)
            {
                doSql = "select max(ID)+1 from SinoRole";
                object ai = helper.ExecScalar(doSql);
                if (ai == DBNull.Value)
                {
                    ai = 1;
                }
                GroupId = Convert.ToInt32(ai);
                doSql   = "insert into SinoRole(ID,RoleName,RoleDes,isAgent) values(@ID,@RoleName,@RoleDes,@isAgent)";
            }
            else
            {
                doSql = "update SinoRole set RoleName=@RoleName,RoleDes=@RoleDes,isAgent=@isAgent where ID=@ID";
            }
            helper.Params.Add("@ID", GroupId);
            helper.Params.Add("@RoleName", RoleName);
            helper.Params.Add("@RoleDes", RoleDes);
            helper.Params.Add("@isAgent", isAgent);
            helper.Execute(doSql);
            JSHelper.WriteScript("alert('修改成功');location.href='membergroup.aspx';");
        }
        protected void GoodsList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            string    changeid = e.CommandArgument.ToString();
            SqlHelper sp       = LocalSqlHelper.WH;

            if (!changeid.IsNumber())
            {
                JSHelper.WriteScript("alert('输入有误');history.back()");
                Response.End();
            }
            string sql = string.Empty;

            if (e.CommandName == "change")
            {
                sql = "select * from TB_GoodsReturn where id=" + changeid;
                DataTable dt = sp.ExecDataTable(sql);
                if (dt.Rows.Count > 0)
                {
                    txtChangePname.Text = dt.Rows[0]["ProductName"].ToString();
                    txtChangeNum.Text   = dt.Rows[0]["ProductCount"].ToString();
                    txtChangeTxt.Text   = dt.Rows[0]["ProductTxm"].ToString();
                    txtChangePid.Value  = changeid;
                }
            }
            if (e.CommandName == "del")
            {
                sql = "delete from TB_GoodsReturn where id=" + changeid;
                sp.Execute(sql);
                Response.Redirect("GoodsChange.aspx?id=" + pid.ToString());
            }
        }
        protected void Button3_Click(object sender, EventArgs e)
        {
            SqlHelper sp = LocalSqlHelper.WH;

            changeId    = txtChangePid.Value;
            changePname = txtChangePname.Text;
            changePnum  = txtChangeNum.Text;
            changePtxt  = txtChangeTxt.Text;
            if (changePname.IsNullOrEmpty() || !changePnum.IsNumber())
            {
                JSHelper.WriteScript("alert('输入有误');history.back()");
                Response.End();
            }
            string sql = string.Empty;

            if (changeId.IsNumber())
            {
                //更改
                sql = "update TB_GoodsReturn set ProductName=@ProductName,ProductCount=@ProductCount,ProductTxm=@ProductTxm where ID=@ID and ChangeFlag=@ChangeFlag";
                sp.Params.Add("@ID", changeId);
            }
            else
            {
                //插入
                sql = "insert into TB_GoodsReturn(ProductName,ProductCount,ProductTxm,DingDan,AgentId,ReturnReson,ReceivedOpter,ChangeFlag) select @ProductName,@ProductCount,@ProductTxm,DingDan,AgentId,ReturnReson,ReceivedOpter,@ChangeFlag from TB_GoodsReturn where ID=@ChangeFlag";
            }
            sp.Params.Add("@ProductName", changePname);
            sp.Params.Add("@ProductCount", changePnum);
            sp.Params.Add("@ProductTxm", changePtxt);
            sp.Params.Add("@ChangeFlag", pid);
            //Response.Write(sql);
            //Response.End();
            sp.Execute(sql);
            JSHelper.WriteScript("alert('编辑成功');location.href='GoodsChange.aspx?id=" + pid.ToString() + "'");
        }
Exemple #5
0
        protected void bindGoods()
        {
            string    sql       = "select * from TB_GoodsReturn with(nolock) where ReturnOrderId is null and ((Status in (6,15) and id in (" + GoodsIdStr + ")) or ChangeFlag in (" + GoodsIdStr + ")) order by ChangeFlag,id";
            SqlHelper sp        = LocalSqlHelper.WH;
            DataTable dt        = null;
            string    dingdan   = string.Empty;
            int       OrderType = 0;

            try
            {
                dt = sp.ExecDataTable(sql);
            }
            catch
            {
                JSHelper.WriteScript("alert('数据有误');history.back();");
                Response.End();
            }
            if (dt.Rows.Count > 0)
            {
                txtReceiver.Text = dt.Rows[0]["UserName"].ToString();
                txtAddress.Text  = dt.Rows[0]["UserAddress"].ToString();
                txtProvince.Text = dt.Rows[0]["UserProvince"].ToString();
                txtCity.Text     = dt.Rows[0]["UserCity"].ToString();
                txtTown.Text     = dt.Rows[0]["UserTown"].ToString();
                txtTel.Text      = dt.Rows[0]["UserTel"].ToString();
                txtAgentId.Text  = dt.Rows[0]["AgentId"].ToString();
            }
            OrderDetail.DataShow(dt);
        }
        /// <summary>
        /// 返货订单相关信息
        /// </summary>
        /// <param name="orderid"></param>
        protected void getOrderDetail(String orderid)
        {
            SqlHelper sp  = LocalSqlHelper.WH;
            string    sql = "select * from TB_GoodsReturnOrder where OrderId=@OrderId";

            sp.Params.Add("@OrderId", orderid);
            DataTable dt = sp.ExecDataTable(sql);

            if (dt.Rows.Count > 0)
            {
                txtAgentId.Text  = dt.Rows[0]["AgentId"].ToString();
                txtReceiver.Text = dt.Rows[0]["ReveivedName"].ToString();
                txtProvince.Text = dt.Rows[0]["province"].ToString();
                txtCity.Text     = dt.Rows[0]["city"].ToString();
                txtTown.Text     = dt.Rows[0]["xian"].ToString();
                txtAddress.Text  = dt.Rows[0]["PostAddress"].ToString();
                txtTel.Text      = dt.Rows[0]["UserTel"].ToString();
                txtRemark.Text   = dt.Rows[0]["Remark"].ToString();
                Status           = Convert.ToInt32(dt.Rows[0]["OrderStatus"]);
            }
            else
            {
                JSHelper.WriteScript("alert('订单数据有误');history.back();");
                Response.End();
            }
            //根据状态获取处理步骤
            switch (Status)
            {
            case 0:                                                                                                  //订单待打印
                doStatus.Items.Add(new ListItem(Warehousing.Business.GoodsReturnHelper.getOrderStutusText(3), "3")); //订单已发货
                doStatus.Items.Add(new ListItem(Warehousing.Business.GoodsReturnHelper.getOrderStutusText(4), "4")); //订单取消
                break;
            }
        }
Exemple #7
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (Convert.ToInt32(Request["sm_status"]) == 0)
            {
                JSHelper.WriteScript("alert('请选择审核方式');history.back();");
                Response.End();
            }
            if (Business.StorageHelper.checkTxmIsBlank(id))
            {
                JSHelper.WriteScript("alert('该批次下产品存在缺少条码,请修改后再审核!');history.back();");
                Response.End();
            }
            if (Session["anti_in_refresh"].ToString() == "0")
            {
                JSHelper.WriteScript("alert('请勿重复提交!');history.back();");
                Response.End();
            }
            Session["anti_in_refresh"] = "0";
            if (Convert.ToInt32(Request["sm_status"]) == 1)
            {
                Business.StorageHelper.checkStorageOk(id);
            }
            helper.Params.Clear();
            helper.Params.Add("sm_id", id);
            helper.Params.Add("sm_status", Request["sm_status"]);
            helper.Params.Add("sm_verify_adminid", my_admin_id);
            helper.Update("Tb_storage_main", "sm_id");

            JSHelper.WriteScript("alert('审核完成');location.href='ProductIn.aspx';");
            //Response.Write(RoleList.Text);
            Response.End();
        }
Exemple #8
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (Session["PowerAudit"].ToString() != "1")
            {
                SiteHelper.NOPowerMessage();
            }

            if (Convert.ToInt32(Request["sm_status"]) == 0)
            {
                JSHelper.WriteScript("alert('请选择审核方式');history.back();");
                Response.End();
            }
            //if (Business.StorageHelper.checkTxmIsBlank(id))
            //{
            //    JSHelper.WriteScript("alert('该批次下产品存在缺少条码,请修改后再审核!');history.back();");
            //    Response.End();
            //}

            if (Convert.ToInt32(Request["sm_status"]) == 1)
            {
                // Business.StorageHelper.checkStorageOk(id);
            }
            helper.Params.Clear();
            helper.Params.Add("sm_id", id);
            helper.Params.Add("sm_status", Request["sm_status"]);
            helper.Update("Tb_plan_main", "sm_id");

            JSHelper.WriteScript("alert('审核完成');location.href='ProductPlan.aspx';");
            //Response.Write(RoleList.Text);
            Response.End();
        }
Exemple #9
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string[] arr_stock_id = Request.Form["stock_id"].Split(',');
            string[] arr_shelf_no = Request.Form["shelf_no"].Split(',');
            string   DoWhat       = string.Empty;
            string   old_shelf_no = string.Empty;

            for (int i = 0; i < arr_stock_id.Length; i++)
            {
                helper.Params.Clear();
                helper.Params.Add("stock_id", arr_stock_id[i]);
                DataTable dt = helper.ExecDataTable("select * from ProductStock with(nolock) where stock_id=@stock_id");
                old_shelf_no = Convert.ToString(dt.Rows[0]["shelf_no"]);
                if (!old_shelf_no.Equals(arr_shelf_no[i]))
                {
                    helper.Params.Clear();
                    helper.Params.Add("stock_id", arr_stock_id[i]);
                    helper.Params.Add("shelf_no", arr_shelf_no[i]);
                    helper.Update("ProductStock", "stock_id");
                    // StorageHelper.changeStock(Convert.ToInt32(dt.Rows[0]["warehouse_id"]), Convert.ToInt32(dt.Rows[0]["pro_id"]), change_quantity, "", "手工库存调整,by:" + Session["LoginName"].ToString());
                    DoWhat = "StockId:" + arr_stock_id[i] + ",原仓位:" + old_shelf_no + ",新仓位:" + arr_shelf_no[i];
                    SiteHelper.writeLog("仓位调整", DoWhat);
                }
            }

            fromUrl = Request["fromUrl"];
            if (fromUrl.IsNullOrEmpty())
            {
                fromUrl = "ProductStock.aspx";
            }
            JSHelper.WriteScript("alert('编辑成功');location.href='" + fromUrl + "';");
            //Response.Write(RoleList.Text);
            Response.End();
        }
        protected void GoodsList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            string act = e.CommandName;

            if (act == "edit")
            {
                SqlHelper sp     = LocalSqlHelper.WH;
                string    typeid = e.CommandArgument.ToString();
                if (!typeid.IsNumber())
                {
                    JSHelper.WriteScript("alert('参数有误');history.back();");
                    Response.End();
                }
                string sql = "select * from Tb_GoodsReturnReson with(nolock) where typeId=@typeId";
                sp.Params.Add("@typeId", typeid);
                DataTable dt = sp.ExecDataTable(sql);
                if (dt.Rows.Count > 0)
                {
                    txtTypeName.Text = dt.Rows[0]["typeName"].ToString();
                    if (Convert.ToInt32(dt.Rows[0]["isHidden"]) == 1)
                    {
                        rbIsHidden.SelectedValue = "1";
                    }
                    else
                    {
                        rbIsHidden.SelectedValue = "0";
                    }
                    hdTypeId.Value = dt.Rows[0]["typeId"].ToString();
                    Button1.Text   = "更改原因";
                }
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string typeName = txtTypeName.Text;

            if (typeName.IsNullOrEmpty())
            {
                JSHelper.WriteScript("alert('返货原因不能为空');history.back();");
                Response.End();
            }
            string typeid   = hdTypeId.Value;
            string sql      = string.Empty;
            string ishidden = rbIsHidden.SelectedValue;

            if (Convert.ToInt32(typeid) > 0)
            {
                //修改
                sql = "update Tb_GoodsReturnReson set typeName=@typeName,isHidden=@isHidden where typeid=" + typeid;
            }
            else
            {
                sql = "insert into Tb_GoodsReturnReson(typeName,isHidden) values(@typeName,@isHidden)";
            }
            SqlHelper sp = LocalSqlHelper.WH;

            sp.Params.Add("@typeName", typeName);
            sp.Params.Add("@isHidden", ishidden);
            sp.Execute(sql);
            JSHelper.WriteScript("alert('操作成功');location.href='GoodsReturnReson.aspx'");
            Response.End();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            trace_id = Request.QueryString["trace_id"].IsNumber() ? Convert.ToInt32(Request.QueryString["trace_id"]) : 0;
            SqlHelper helper = LocalSqlHelper.WH;
            string    Sql    = "select isnull(sum(price*quantity),0) as all_sales,isnull(sum(price*quantity),0) as all_quantity from Tb_cashier_cart where cashier_id=@cashier_id and is_return=1 and trace_id=@trace_id";

            helper.Params.Add("@cashier_id", my_admin_id);
            helper.Params.Add("@trace_id", trace_id);
            DataTable dt = helper.ExecDataTable(Sql);

            all_sales = 0 - Convert.ToDouble(dt.Rows[0]["all_sales"]);

            if (!Page.IsPostBack)
            {
                TextRealMoney.Text = all_sales.ToString();
                int all_quantity = Convert.ToInt32(dt.Rows[0]["all_quantity"]);
                if (all_quantity == 0)
                {
                    JSHelper.WriteScript("alert('没有待结算商品');history.back();");
                    return;
                }

                helper.Params.Clear();
                Sql = "select *,sales=price*quantity from Tb_cashier_cart where  cashier_id=@cashier_id and is_return=1 and trace_id=@trace_id";
                helper.Params.Add("@cashier_id", my_admin_id);
                helper.Params.Add("@trace_id", trace_id);
                dt = helper.ExecDataTable(Sql);
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    // total_money += Convert.ToDouble(dt.Rows[i]["sales"]);
                    // total_goods += Convert.ToDouble(dt.Rows[i]["quantity"]);
                }
                GoodsList.DataShow(dt);
            }
        }
Exemple #13
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string cancelid = Convert.ToString(Request["cancelid"]);

            if (cancelid.IsNullOrEmpty())
            {
                JSHelper.WriteScript("alert('请选择要取消的订单商品');history.back();");
                Response.End();
            }
            //Response.Write(cancelid);
            //Response.End();
            SqlHelper conn = LocalSqlHelper.WH;

            string[] ids      = cancelid.Split(',');
            string   msgstr   = "";
            string   truename = Convert.ToString(Session["LoginName"]);

            for (int i = 0; i < ids.Length; i++)
            {
                conn.Params.Clear();
                conn.OutParams.Clear();
                conn.Params.Add("@id", ids[i]);
                conn.Params.Add("@validate_user", truename);
                SqlParameter msg = new SqlParameter("@msg", SqlDbType.NVarChar, 50);
                msg.Direction = ParameterDirection.Output;
                conn.OutParams.Add(msg);
                conn.Run("Order_Cancel_Distribution_Warehouse_confirm");
                msgstr += msg.Value + "\\n";
            }
            JSHelper.WriteScript("alert('" + msgstr + "');location.href='DistributionOrderCancel.aspx'");
        }
Exemple #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SiteHelper.CheckLogin();
            SiteHelper.GetPageUrlpower("Complaint/ComplaintList.aspx");
            if (Session["PowerRead"].ToString() != "1")
            {
                SiteHelper.NOPowerMessage();
            }

            Id = Request["id"];
            if (!Id.IsNumber())
            {
                JSHelper.WriteScript("alert('数据传递有误');history.back();");
                Response.End();
            }

            if (!IsPostBack)
            {
                SqlHelper sp   = LocalSqlHelper.WH;
                string    sql  = "select * from Tb_Complaint where id=" + Id;
                DataTable gdDt = sp.ExecDataTable(sql);
                if (gdDt.Rows.Count > 0) //修改时
                {
                    txtUserId.Text          = gdDt.Rows[0]["UserId"].ToString();
                    txtUserName.Text        = gdDt.Rows[0]["UserName"].ToString();
                    txtuserTel.Text         = gdDt.Rows[0]["userTel"].ToString();
                    txtComplaintTime.Text   = gdDt.Rows[0]["ComplaintTime"].ToString();
                    txtComplaintDetail.Text = gdDt.Rows[0]["ComplaintDetail"].ToString();
                    txtaddOperator.Text     = gdDt.Rows[0]["addOperator"].ToString();
                    txtdoContent.Text       = gdDt.Rows[0]["doContent"].ToString();
                    txtdoOperator.Text      = gdDt.Rows[0]["doOperator"].ToString();
                    ddtypeId.Text           = Business.ComplaintHelper.getTypeName(gdDt.Rows[0]["typeId"]);
                    string dostatus = gdDt.Rows[0]["status"].ToString();
                    switch (dostatus)
                    {
                    case "0":
                        ddStatus.Items.Add(new ListItem(Warehousing.Business.ComplaintHelper.getStutusText(1), "1"));
                        ddStatus.Items.Add(new ListItem(Warehousing.Business.ComplaintHelper.getStutusText(2), "2"));
                        break;

                    case "1":
                        ddStatus.Items.Add(new ListItem(Warehousing.Business.ComplaintHelper.getStutusText(1), "1"));
                        ddStatus.Items.Add(new ListItem(Warehousing.Business.ComplaintHelper.getStutusText(2), "2"));
                        break;

                    case "2":
                        ddStatus.Items.Add(new ListItem(Warehousing.Business.ComplaintHelper.getStutusText(2), "2"));
                        break;
                    }
                    txtdoOperator.Attributes.Add("onchange", "checkLoginId(this.value);");
                    fromUrl.Value = Request.ServerVariables["HTTP_REFERER"];
                }
                else
                {
                    JSHelper.WriteScript("alert('数据传递有误');history.back();");
                    Response.End();
                }
            }
        }
Exemple #15
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     if (my_warehouse_id > 0 && myStorageInfo.is_caigou == 0)
     {
         JSHelper.WriteScript("alert('没有直接采购入库权限');history.back();");
         Response.End();
     }
 }
Exemple #16
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            helper.Params.Clear();
            helper.Params.Add("sm_supplier", sm_supplier.Text);
            helper.Params.Add("sm_type", Request["sm_type"]);
            helper.Params.Add("sm_sn", sm_sn.Text);
            helper.Params.Add("sm_date", Request["sm_date"]);
            helper.Params.Add("sm_operator", sm_operator.Text);
            helper.Params.Add("sm_remark", sm_remark.Text);

            if (id == 0)
            {
                helper.Params.Add("sm_adminid", HttpContext.Current.Session["ManageUserId"].ToString());
                helper.Insert("Tb_storage_main");
                int sm_id = Convert.ToInt32(helper.ExecScalar("select top 1 sm_id from Tb_storage_main order by sm_id desc"));

                string p_name = Request.Form["p_name"];
                if (p_name.IsNotNullAndEmpty())
                {
                    string[] arr_p_name      = Request.Form["p_name"].Split(',');
                    string[] arr_p_serial    = Request.Form["p_serial"].Split(',');
                    string[] arr_p_brand     = Request.Form["p_brand"].Split(',');
                    string[] arr_p_unit      = Request.Form["p_unit"].Split(',');
                    string[] arr_p_spec      = Request.Form["p_spec"].Split(',');
                    string[] arr_p_model     = Request.Form["p_model"].Split(',');
                    string[] arr_p_quantity  = Request.Form["p_quantity"].Split(',');
                    string[] arr_p_price     = Request.Form["p_price"].Split(',');
                    string[] arr_p_baseprice = Request.Form["p_baseprice"].Split(',');
                    for (int i = 0; i < arr_p_name.Length; i++)
                    {
                        if (arr_p_name[i].IsNotNullAndEmpty())
                        {
                            helper.Params.Clear();
                            helper.Params.Add("sm_id", sm_id);
                            helper.Params.Add("p_name", arr_p_name[i]);
                            helper.Params.Add("p_serial", arr_p_serial[i]);
                            helper.Params.Add("p_brand", arr_p_brand[i]);
                            helper.Params.Add("p_unit", arr_p_unit[i]);
                            helper.Params.Add("p_spec", arr_p_spec[i]);
                            helper.Params.Add("p_model", arr_p_model[i]);
                            helper.Params.Add("p_quantity", arr_p_quantity[i].IsNumber() ? arr_p_quantity[i] : "0");
                            helper.Params.Add("p_price", arr_p_price[i].IsNumber() ? arr_p_price[i] : "0");
                            helper.Params.Add("p_baseprice", arr_p_baseprice[i].IsNumber() ? arr_p_baseprice[i] : "0");
                            helper.Insert("Tb_storage_product");
                        }
                    }
                }
            }
            else
            {
                helper.Params.Add("sm_id", id);
                helper.Update("Tb_storage_main", "sm_id");
            }
            JSHelper.WriteScript("alert('编辑成功');location.href='ProductIn.aspx';");
            //Response.Write(RoleList.Text);
            Response.End();
        }
Exemple #17
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     if (my_warehouse_id > 0 && myStorageInfo.is_manage == 0)
     {
         JSHelper.WriteScript("alert('非导购管理员不可进行导购管理操作!');history.back();");
         Response.End();
     }
 }
Exemple #18
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (TextLoginName.Text.IsNullOrEmpty())
            {
                JSHelper.WriteScript("alert('工号不能为空');history.back();");
                return;
            }
            if (my_warehouse_id > 0)
            {
                if (WarehouseList.Text == "0")
                {
                    JSHelper.WriteScript("alert('请选择所属仓库');history.back();");
                    return;
                }
            }


            helper.Params.Clear();
            helper.Params.Add("fullname", Textfullname.Text);
            helper.Params.Add("LoginName", TextLoginName.Text);
            helper.Params.Add("IsLock", Request.Form["IsLock"]);
            helper.Params.Add("RoleID", RoleList.Text);
            helper.Params.Add("warehouse_id", WarehouseList.Text);
            try
            {
                if (AdminId == 0)
                {
                    if (TextLoginPwd.Text.IsNullOrEmpty())
                    {
                        JSHelper.WriteScript("alert('密码不能为空!');history.back();");
                        return;
                    }

                    helper.Params.Add("LoginPwd", SinoHelper2.StringHelper.ASP16MD5(TextLoginPwd.Text));

                    helper.Insert("wareHouse_Admin");
                }
                else
                {
                    if (TextLoginPwd.Text.IsNotNullAndEmpty())
                    {
                        helper.Params.Add("LoginPwd", SinoHelper2.StringHelper.ASP16MD5(TextLoginPwd.Text));
                    }
                    helper.Params.Add("id", AdminId);
                    helper.Update("wareHouse_Admin", "id");
                }
            }
            catch
            {
                JSHelper.WriteScript("alert('工号已被占用,请更换!');history.back();");
                return;
            }
            JSHelper.WriteScript("alert('编辑成功');location.href='memberlist.aspx';");
            //Response.Write(RoleList.Text);
            Response.End();
        }
Exemple #19
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string outType = Request["sm_type"];

            if (outType.IsNullOrEmpty() || !outType.IsNumber())
            {
                JSHelper.WriteScript("alert('请选择出库类型');history.back();");
                Response.End();
            }
            Response.Redirect("addProductOut.aspx?outType=" + outType);
        }
Exemple #20
0
        protected void Button3_Click(object sender, EventArgs e)
        {
            string id = Request.Form["id"];

            if (id.IsNullOrEmpty())
            {
                JSHelper.WriteScript("alert('数据有误');history.back();");
                Response.End();
            }
            Response.Redirect("GoodsToOrder.aspx?id=" + id);
        }
Exemple #21
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string UserName = Request.Form["UserName"];
            string Password = Request.Form["Password"];
            string s        = Request.Form["s"];

            if (UserName.IsNullOrEmpty() || Password.IsNullOrEmpty())
            {
                JSHelper.WriteScript("alert('用户名和密码不能为空!');history.back();");
                Response.End();
            }
            if (s.IsNullOrEmpty() || s.Length != 4)
            {
                JSHelper.WriteScript("alert('请正确填写验证码');history.back();");
                Response.End();
            }
            if (s.ToLower() != Request.Cookies["yzmcode"].Value.ToLower())
            {
                JSHelper.WriteScript("alert('验证码有误');history.back();");
                Response.End();
            }
            SqlHelper helper = LocalSqlHelper.WH;
            string    sql    = "select id,LoginPwd,fullname,warehouse_id,RoleID from wareHouse_Admin where IsLock=0 and LoginName=@UserName";

            helper.Params.Add("@UserName", UserName);
            DataTable dt = helper.ExecDataTable(sql);

            if (dt.Rows.Count != 1)
            {
                JSHelper.WriteScript("alert('管理员不存在');history.back();");
                Response.End();
            }
            string LoginPwd = Convert.ToString(dt.Rows[0]["LoginPwd"]);

            if (SinoHelper2.StringHelper.ASP16MD5(Password) != LoginPwd)
            {
                JSHelper.WriteScript("alert('密码有误');history.back();");
                Response.End();
            }
            Session["ManageUserId"] = Convert.ToString(dt.Rows[0]["id"]);;
            Session["LoginName"]    = UserName;
            Session["TrueName"]     = UserName;;
            Session["RoleID"]       = Convert.ToString(dt.Rows[0]["RoleID"]);
            Session["warehouse_id"] = Convert.ToString(dt.Rows[0]["warehouse_id"]);

            Response.Cookies["userInfo"]["ManageUserId"] = Convert.ToString(dt.Rows[0]["id"]);;
            Response.Cookies["userInfo"]["LoginName"]    = UserName;
            Response.Cookies["userInfo"]["TrueName"]     = HttpUtility.UrlEncode(Convert.ToString(dt.Rows[0]["fullname"]));;
            Response.Cookies["userInfo"]["RoleID"]       = Convert.ToString(dt.Rows[0]["RoleID"]);
            Response.Cookies["userInfo"]["warehouse_id"] = Convert.ToString(dt.Rows[0]["warehouse_id"]);
            JSHelper.WriteScript("location.href='Admin.Aspx'");
            Response.End();
        }
Exemple #22
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            helper.Params.Add("sm_status", Request["sm_status"]);
            helper.Params.Add("sm_id", id);
            helper.Update("Tb_storage_main", "sm_id");

            Business.StorageHelper.checkStorageOk(id);

            JSHelper.WriteScript("alert('审核完成');location.href='ProductIn.aspx';");
            //Response.Write(RoleList.Text);
            Response.End();
        }
Exemple #23
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (Session["PowerAudit"].ToString() != "1")
            {
                SiteHelper.NOPowerMessage();
            }

            if (Page.IsValid)
            {
                string sql = string.Empty;


                string doContent  = txtdoContent.Text;
                string doOperator = txtdoOperator.Text;
                string dostatus   = ddStatus.SelectedValue;

                if (SiteHelper.getTrueNameByLoginId(doOperator).IsNullOrEmpty())
                {
                    JSHelper.WriteScript("alert('请正确输入处理人工号');history.back();");
                    Response.End();
                }

                if (!dostatus.IsNumber())
                {
                    JSHelper.WriteScript("alert('请选择处理状态');history.back();");
                    Response.End();
                }

                sql = "update Tb_Complaint set doOperator=@doOperator,doContent=@doContent,status=@dostatus,updateTime=getdate()";
                if (dostatus == "2")
                {
                    if (doContent.IsNullOrEmpty())
                    {
                        JSHelper.WriteScript("alert('处理结果不能为空');history.back();");
                        Response.End();
                    }
                    sql += ",endTime=getdate()";
                }
                sql += " where id=" + Id;
                SqlHelper sp = LocalSqlHelper.WH;

                sp.Params.Add("@doContent", doContent);
                sp.Params.Add("@doOperator", doOperator);
                sp.Params.Add("@dostatus", dostatus);
                sp.Execute(sql);

                //写处理日志
                string doWhat = "客诉处理:状态至" + dostatus + "(" + Warehousing.Business.ComplaintHelper.getStutusText(Convert.ToInt32(dostatus)) + "),处理人为:" + doOperator + ",处理意见:" + doContent;
                SiteHelper.writeLog("客诉处理", doWhat, Convert.ToInt32(Id));

                JSHelper.WriteScript("alert('客诉处理成功');location.href='ComplaintList.aspx'");
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            helper.Params.Clear();
            string areaCode = AreaCode.Text;
            string content  = remark.Text;

            if (content.IsNullOrEmpty())
            {
                JSHelper.WriteScript("alert('盘点数据不能为空!');history.back();");
            }
            content = content.Replace(",", ",");
            content = content.Replace("\t", ",");
            string[] oneDate = content.Split('\r');

            //数据检查
            for (int i = 0; i < oneDate.Length; i++)
            {
                if (oneDate[i].Trim().IsNotNullAndEmpty())
                {
                    string[] info = oneDate[i].Split(',');
                    if (info.Length < 2)
                    {
                        JSHelper.WriteScript("alert('盘点录入数据格式不对,注意是否最后有空白行');");
                        Response.End();
                    }
                    if (!info[1].IsNumber() || info[0].IsNullOrEmpty())
                    {
                        JSHelper.WriteScript("alert('格式不对:存在条码为空或数量非数值');");
                        Response.End();
                    }
                }
            }

            //数据写入
            string sql = string.Empty;

            for (int i = 0; i < oneDate.Length; i++)
            {
                if (oneDate[i].Trim().IsNotNullAndEmpty())
                {
                    string[] info = oneDate[i].Split(',');
                    sql = "insert into Tb_check_input(main_id,pro_txm,check_num,area_code) values(" + id + ",'" + info[0].Trim() + "'," + info[1].Trim() + ",'" + areaCode + "')";
                    //Response.Write(sql);
                    helper.Execute(sql);
                }
            }


            JSHelper.WriteScript("alert('编辑成功');location.href='CheckStock.aspx';");
            //Response.Write(RoleList.Text);
            Response.End();
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string AgentId = txtAgentId.Text;
            string OrderId = txtOrderId.Text;

            queryStr = "agentid=" + AgentId + "&OrderId=" + OrderId;
            if (!AgentId.IsNumber() && !OrderId.IsNumber())
            {
                JSHelper.WriteScript("alert('请正确输入查询条件');history.back();");
                Response.End();
            }
            Response.Redirect("GoodsReturnAdd.aspx?" + queryStr);
        }
Exemple #26
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                int       checkExist = 0;
                string    AgentId    = Request["txtAgentId"];
                string    Receiver   = Request["txtReceiver"];
                string    Address    = Request["txtAddress"];
                string    Province   = Request["txtProvince"];
                string    City       = Request["txtCity"];
                string    Town       = Request["txtTown"];
                string    Tel        = Request["txtTel"];
                string    Remark     = Request["txtRemark"];
                string    sql        = string.Empty;
                string    OrderId    = Warehousing.Business.GoodsReturnHelper.genReturnGoodsOrderId();
                SqlHelper sp         = LocalSqlHelper.WH;
                //订单生成



                //检查是否存在同个代理的其它待发订单
                sql = "select top 1 * from TB_GoodsReturnOrder where OrderStatus in (8,15) and AgentId='" + AgentId + "'";


                sql  = "insert into TB_GoodsReturnOrder(OrderId, AddTime, OrderStatus, province, city, xian, PostAddress, UserTel, AgentId, ReveivedName, Remark)";
                sql += " values(@OrderId, getdate(),0, @province, @city, @xian, @PostAddress, @UserTel, @AgentId, @ReveivedName,  @Remark)";


                sp.Params.Add("@OrderId", OrderId);
                sp.Params.Add("@province", Province);
                sp.Params.Add("@city", City);
                sp.Params.Add("@xian", Town);
                sp.Params.Add("@PostAddress", Address);
                sp.Params.Add("@UserTel", Tel);
                sp.Params.Add("@AgentId", AgentId);
                sp.Params.Add("@ReveivedName", Receiver);
                sp.Params.Add("@Remark", Remark);
                sp.Execute(sql);

                sql = "update TB_GoodsReturn set ReturnOrderId='" + OrderId + "',Status=8 where ReturnOrderId is null and ((Status in (6,15) and id in (" + GoodsIdStr + ")) or ChangeFlag in (" + GoodsIdStr + "))";
                sp.Execute(sql);

                //写操作日志
                string oldStatus = "6";
                string newStatus = "8";
                string dowhat    = GoodsIdStr + "商品进行处理,生成订单" + OrderId + ",状态由(" + Warehousing.Business.GoodsReturnHelper.getStutusText(Convert.ToInt32(oldStatus)) + oldStatus + ")至(" + Warehousing.Business.GoodsReturnHelper.getStutusText(Convert.ToInt32(newStatus)) + oldStatus + ")";
                SiteHelper.writeLog("返货商品处理", dowhat);

                JSHelper.WriteScript("alert('返货商品提交成功');location.href='GoodsReturnOrder.aspx'");
            }
        }
Exemple #27
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            string tpl_id_selected = Request["tpl_id"];

            if (tpl_id_selected.IsNullOrEmpty())
            {
                JSHelper.WriteScript("alert('请至少选中一个产品模板');history.back()");
                Response.End();
            }
            string[]  arr_tpl_id  = tpl_id_selected.Split(',');
            int       select_flag = 0;
            SqlHelper helper      = LocalSqlHelper.WH;

            for (int i = 0; i < arr_tpl_id.Length; i++)
            {
                if (arr_tpl_id[i].IsNumber())
                {
                    //判断模板是否存在
                    string sql = "select top 1 * from Tb_Working_main with(nolock) where work_id=0 and operator_id=@operator_id and tpl_id=@tpl_id";
                    helper.Params.Clear();
                    helper.Params.Add("operator_id", HttpContext.Current.Session["ManageUserId"].ToString());
                    helper.Params.Add("tpl_id", arr_tpl_id[i]);
                    DataTable dt = helper.ExecDataTable(sql);
                    if (dt.Rows.Count == 0)
                    {
                        //加入WorkingCart
                        helper.Params.Clear();
                        helper.Params.Add("tpl_id", arr_tpl_id[i]);
                        helper.Params.Add("operator_id", HttpContext.Current.Session["ManageUserId"].ToString());
                        helper.Params.Add("quantity", 1);
                        helper.Insert("Tb_Working_main");

                        helper.Params.Clear();
                        int new_wmid = Convert.ToInt32(helper.ExecScalar("select top 1 wm_id from Tb_Working_main order by wm_id desc"));

                        helper.Params.Clear();
                        helper.Params.Add("tpl_id", arr_tpl_id[i]);
                        string sql_new = "insert into dbo.Tb_Working_material(wm_id,tpt_id,pro_txm,pro_id,pro_nums,pro_real_nums) select " + new_wmid + ",tpl_id,pro_txm_from,pro_id_from,pro_nums,pro_nums from dbo.Tb_template_material where tpl_id=@tpl_id ";
                        helper.Execute(sql_new);
                    }
                    select_flag = 1;
                }
            }
            if (select_flag == 0)
            {
                JSHelper.WriteScript("alert('请至少选中一个产品模板');history.back()");
                Response.End();
            }

            Response.Redirect("WorkingCart.Aspx?" + queryStr);
        }
Exemple #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SiteHelper.CheckLogin();
            SiteHelper.GetPageUrlpower("Storage/ProductOut.aspx");
            id      = Convert.ToInt32(Request["id"]);
            sm_id   = Convert.ToInt32(Request["sm_id"]);
            work_id = Convert.ToInt32(Request["work_id"]);
            if (sm_id > 0 && work_id > 0)
            {
                JSHelper.WriteScript("alert('工单有误');history.back();");
                Response.End();
            }
            if (sm_id > 0)
            {
                object_type = "Storage";

                // JSHelper.WriteScript("alert('请对应相应工单');history.back();");
                // Response.End();
            }
            if (work_id > 0)
            {
                object_type = "process";
            }
            if (!Page.IsPostBack)
            {
                string Sql = "select * from Tb_FinancialFlow where id=@id";
                helper.Params.Add("@id", id);
                DataTable dt = helper.ExecDataTable(Sql);
                if (dt.Rows.Count > 0)
                {
                    if (Session["PowerEdit"].ToString() != "1")
                    {
                        SiteHelper.NOPowerMessage();
                    }
                    Textpay_money.Text      = Convert.ToString(dt.Rows[0]["pay_money"]);
                    Textpay_date.Text       = Convert.ToString(dt.Rows[0]["pay_date"]);
                    Textpay_worker.Text     = Convert.ToString(dt.Rows[0]["pay_worker"]);
                    Textreceive_worker.Text = Convert.ToString(dt.Rows[0]["receive_worker"]);
                    Textremark.Text         = Convert.ToString(dt.Rows[0]["remark"]);
                    IsCancel = Convert.ToString(dt.Rows[0]["is_cancel"]);
                }
                else
                {
                    if (Session["PowerAdd"].ToString() != "1")
                    {
                        SiteHelper.NOPowerMessage();
                    }
                }
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (TextRemark.Text.IsNullOrEmpty())
            {
                JSHelper.WriteScript("alert('请填写修改备注');history.back();");
                return;
            }
            string[] arr_stock_id    = Request.Form["stock_id"].Split(',');
            string[] arr_stock_price = Request.Form["stock_price"].Split(',');
            string   DoWhat          = string.Empty;
            decimal  old_price       = 0;

            for (int i = 0; i < arr_stock_id.Length; i++)
            {
                if (arr_stock_price[i].IsNumber())
                {
                    helper.Params.Clear();
                    helper.Params.Add("stock_id", arr_stock_id[i]);
                    DataTable dt = helper.ExecDataTable("select * from ProductStock with(nolock) where stock_id=@stock_id");
                    old_price = Convert.ToDecimal(dt.Rows[0]["stock_price"]);
                    decimal change_price = Convert.ToDecimal(arr_stock_price[i]) - old_price;
                    if (change_price != 0)
                    {
                        helper.Params.Clear();
                        helper.Params.Add("stock_id", arr_stock_id[i]);
                        helper.Params.Add("stock_price", arr_stock_price[i]);
                        helper.Update("ProductStock", "stock_id");

                        helper.Params.Clear();
                        string update_sql = "update Tb_cashier_cart set price=@price where store_id=@warehouse_id and spec_id=@pro_id";
                        helper.Params.Add("@price", arr_stock_price[i]);
                        helper.Params.Add("@warehouse_id", dt.Rows[0]["warehouse_id"]);
                        helper.Params.Add("@pro_id", dt.Rows[0]["pro_id"]);
                        helper.Execute(update_sql);
                        //StorageHelper.changeStock(Convert.ToInt32(dt.Rows[0]["warehouse_id"]), Convert.ToInt32(dt.Rows[0]["pro_id"]), change_quantity, "", "手工库存调整(" + TextRemark.Text + "),by:" + Session["LoginName"].ToString());
                        DoWhat = "StockId:" + arr_stock_id[i] + ",原价格:" + old_price + ",新价格:" + arr_stock_price[i];
                        SiteHelper.writeLog("价格调整", DoWhat);
                    }
                }
            }

            fromUrl = Request["fromUrl"];
            if (fromUrl.IsNullOrEmpty())
            {
                fromUrl = "ProductStock.aspx";
            }
            JSHelper.WriteScript("alert('编辑成功');location.href='" + fromUrl + "';");
            //Response.Write(RoleList.Text);
            Response.End();
        }
Exemple #30
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string newRoleId = string.Empty;

            newRoleId = RoleList.Text;
            helper.Params.Clear();
            string uSql = "update wareHouse_Admin set RoleID=@RoleID where id=@id";

            helper.Params.Add("@id", RoleId);
            helper.Params.Add("@RoleID", newRoleId);
            helper.Execute(uSql);
            JSHelper.WriteScript("alert('修改成功');location.href='memberlist.aspx';");
            Response.Write(newRoleId);
            Response.End();
        }