コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            permission();
            //获取客户
            dsCustom = libraryCollectionBll.getCustomer();
            string op = Request["op"];

            //getData();
            if (op == "paging")
            {
                getData();
            }
            if (op == "logout")
            {
                //删除身份凭证
                FormsAuthentication.SignOut();
                //设置Cookie的值为空
                Response.Cookies[FormsAuthentication.FormsCookieName].Value = null;
                //设置Cookie的过期时间为上个月今天
                Response.Cookies[FormsAuthentication.FormsCookieName].Expires = DateTime.Now.AddMonths(-1);
            }
            if (op == "add")
            {
                Insert();
            }
            if (op == "delete")//删除单头
            {
                Delete();
            }
            if (op == "addMonomer")//跳转到添加销售单体页面
            {
                string sellId = Request["sohId"];
                string state  = Request["state"];
                Session["sellId"] = sellId;
                Session["type"]   = "add";
                if (state == "已完成")
                {
                    Response.Write("单据已完成,无法进行修改");
                    Response.End();
                }
                else
                {
                    Response.Write("处理中");
                    Response.End();
                }
            }
            if (op == "searchMonomer")
            {
                string sellId = Request["sohId"];
                Session["sellId"] = sellId;
                Session["type"]   = "search";
            }
        }
コード例 #2
0
ファイル: customerRs.aspx.cs プロジェクト: kiritobin/bms
        protected void Page_Load(object sender, EventArgs e)
        {
            user = (User)Session["user"];
            permission();
            dsCustom = libraryCollectionBll.getCustomer();
            string op = Request["op"];

            getData();
            if (op == "logout")
            {
                //删除身份凭证
                FormsAuthentication.SignOut();
                //设置Cookie的值为空
                Response.Cookies[FormsAuthentication.FormsCookieName].Value = null;
                //设置Cookie的过期时间为上个月今天
                Response.Cookies[FormsAuthentication.FormsCookieName].Expires = DateTime.Now.AddMonths(-1);
            }
            if (op == "print")
            {
                print();
            }
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            permission();
            //获取地区下拉框数据
            dsCustom = libraryCollectionBll.getCustomer();

            //getData();
            custom = Request["custom"];
            string action = Request["action"];
            string op     = Request["op"];

            if (op == "change" || op == "paging")
            {
                getData();
            }
            if (action == "import")
            {
                DataTable dtInsert = new DataTable();
                System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
                watch.Start();
                dtInsert = excelToDt();

                TimeSpan ts = watch.Elapsed;
                dtInsert.TableName = "T_LibraryCollection"; //导入的表名
                int a = userBll.BulkInsert(dtInsert);
                watch.Stop();
                double minute = ts.TotalMinutes; //计时
                string m      = minute.ToString("0.00");
                if (a > 0)
                {
                    //int cf = row - a;
                    Session["path"] = null; //清除路径session
                    //Response.Write("导入成功,总数据有" + row+"条,共导入"+a+"条数据"+",共用时:"+ m+"分钟");
                    Response.Write("导入成功,共导入数据" + a + "条数据");
                    Response.End();
                }
                else
                {
                    Session.Remove("path");
                    //Response.Write("导入失败,总数据有" + row + "条,共导入" + a + "条数据");
                    Response.Write("导入失败,远程服务器未响应");
                    Response.End();
                }
            }
            else if (action == "del")
            {
                int    custom = Convert.ToInt32(Request["custom"]);
                Result result = libraryCollectionBll.deleteByCus(custom);
                if (result == Result.除成功)
                {
                    Response.Write("删除成功");
                    Response.End();
                }
                else
                {
                    Response.Write("删除失败");
                    Response.End();
                }
            }
            if (op == "logout")
            {
                //删除身份凭证
                FormsAuthentication.SignOut();
                //设置Cookie的值为空
                Response.Cookies[FormsAuthentication.FormsCookieName].Value = null;
                //设置Cookie的过期时间为上个月今天
                Response.Cookies[FormsAuthentication.FormsCookieName].Expires = DateTime.Now.AddMonths(-1);
            }
        }