예제 #1
0
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Attributes.Add("onmouseover", "bg=this.style.backgroundColor;this.style.backgroundColor='#FFFFCC'");
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=bg");

            e.Row.Cells[3].Text = Encryption.Encryption.GetDecipherName(e.Row.Cells[3].Text.ToString());
            e.Row.Cells[4].Text = Encryption.Encryption.GetDecipherName(e.Row.Cells[4].Text.ToString());
            int curr = Convert.ToInt32(DBHelper.ExecuteScalar("select rate from Currency where id=standardMoney"));

            // e.Row.Cells[5].Text = Double.Parse(e.Row.Cells[5].Text.ToString()).ToString("0.00");

            //Label lab = (Label)e.Row.FindControl("StoreLevelInt");
            ////string l = DBHelper.ExecuteScalar("select levelstr from bsco_level where levelflag=1 and levelint = " + Convert.ToInt32(lab.Text.ToString()) + "").ToString();
            //string l= getStoLevelStr()
            //lab.Text = l.ToString();
            Label labScp = (Label)e.Row.FindControl("country");

            string scp = DBHelper.ExecuteScalar("select top 1 country from city where CPCCode like '" + labScp.Text.ToString() + "%'").ToString();
            labScp.Text = scp.ToString();
            string storeid = e.Row.Cells[1].Text;
            int    n       = StoreInfoEditBLL.getMemberCount(storeid);
            int    EdCount = 1201;
            int    DeCount = 1202;
            EdCount = Permissions.GetPermissions(EnumCompanyPermission.CustomerUpdateStore);
            DeCount = Permissions.GetPermissions(EnumCompanyPermission.CustomerStoreManageDelete);
            HyperLink modlink = (HyperLink)e.Row.FindControl("Hyperlink1");
            if (EdCount.ToString() == "1201" || EdCount.ToString() == "1202")
            {
                modlink.Visible = true;
            }
            else
            {
                modlink.Visible = false;
            }
            if (DeCount.ToString() == "1202")
            {
                ((LinkButton)e.Row.FindControl("DelLink")).Attributes["onclick"] = "return confirm('" + GetTran("000765", "此操作为不可恢复操作,您确认要删除吗?") + "')";
            }
            else
            {
                ((LinkButton)e.Row.FindControl("DelLink")).Visible = false;
            }
            string manageId = BLL.CommonClass.CommonDataBLL.getManageID(2);
            if (storeid == "9999999999" || storeid == manageId)
            {
                ((LinkButton)e.Row.FindControl("DelLink")).Visible = false;
            }
        }
        else if (e.Row.RowType == DataControlRowType.Header)
        {
            e.Row.Attributes.Add("style", "background-image:url('images/tabledp.gif')");
            Translations();
        }
    }
예제 #2
0
    protected void givSearchStoreInfo_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int ID = Convert.ToInt32(e.CommandArgument.ToString());

        if (e.CommandName == "del")
        {
            GridViewRow row     = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;
            string      storeid = row.Cells[1].Text;
            int         k       = StoreInfoEditBLL.getMemberCount(storeid);
            if (k == 0)
            {
                int i = 0;
                StoreInfoEditBLL           seb       = new StoreInfoEditBLL();
                BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("storeinfo", "(ltrim(rtrim(id)))");
                cl_h_info.AddRecord(ID);
                i = seb.DelStore(ID);
                cl_h_info.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company4, Session["Company"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype2);
                if (i > 0)
                {
                    //Response.Write("<script language='javascript'>alert('删除成功!')</script>");
                    this.msg = "<script language='javascript'>alert('" + GetTran("000749", "删除成功!") + "')</script>";
                    BtnSeach_Click(null, null);
                }
                else
                {
                    //Response.Write("<script language='javascript'>alert('删除失败!')</script>");
                    this.msg = "<script language='javascript'>alert('" + GetTran("000417", "删除失败!") + "')</script>";
                    return;
                }
            }
            else
            {
                this.msg = "<script language='javascript'>alert('" + GetTran("000756", "对不起,该店铺已经发生了业务关系,不能删除!") + "')</script>";
                return;
            }
        }
        else
        {
            BtnSeach_Click(null, null);
        }
    }