//加载事件
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Rep.DataSource = T_EmployeeBLL.GetListTable();
         Rep.DataBind();
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            string act = Request["act"] == null ? "" : Request["act"].ToString();
            List <ming_xi_info> list = new List <ming_xi_info>();

            if (act.Equals("Jiansuo"))
            {
                list = selectWhere();
            }
            if (!act.Equals("Jiansuo") && Session["username"] != null && Session["gs_name"] != null)
            {
                userid = Session["username"].ToString();
                gongsi = Session["gs_name"].ToString();
                list   = cal.ming_xi_select(Session["username"].ToString(), Session["gs_name"].ToString());
            }
            Rep.DataSource = list;
            Rep.DataBind();
        }
示例#3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         string act = Request["act"] == null ? "" : Request["act"].ToString();
         if (act.Equals("del"))
         {
             del();
         }
         List <zl_and_jc_info> jichu = cal.select_jczl(Session["username"].ToString(), Session["gs_name"].ToString());
         Rep.DataSource = jichu;
         Rep.DataBind();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["username"] != null && Session["gs_name"] != null)
            {
                string            act  = Request["act"] == null ? "" : Request["act"];
                List <jxc_z_info> list = new List <jxc_z_info>();

                if (act.Equals("Jiansuo"))
                {
                    list = jiansuo();
                }
                else
                {
                    list = can.jinxiaocun_hz(Session["username"].ToString(), Session["gs_name"].ToString());
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (list[i].Cpsl_3 == "")
                        {
                            list[i].jc_jc = (0 + Convert.ToInt32(list[i].Cpsl_1) - Convert.ToInt32(list[i].Cpsl_2)).ToString();
                        }
                        else if (list[i].Cpsl_1 == "")
                        {
                            list[i].jc_jc = (Convert.ToInt32(list[i].Cpsl_3) + 0 - Convert.ToInt32(list[i].Cpsl_2)).ToString();
                        }
                        else if (list[i].Cpsl_2 == "")
                        {
                            list[i].jc_jc = (Convert.ToInt32(list[i].Cpsl_3) + Convert.ToInt32(list[i].Cpsl_1) - 0).ToString();
                        }
                        else
                        {
                            list[i].jc_jc = (Convert.ToInt32(list[i].Cpsl_3) + Convert.ToInt32(list[i].Cpsl_1) - Convert.ToInt32(list[i].Cpsl_2)).ToString();
                        }



                        //if (Convert.ToInt32(list[i].jc_jc) >= 0)
                        //{
                        //    if (list[i].Cpje_3 == "")
                        //    {
                        //        list[i].jc_je = (0 + Convert.ToInt32(list[i].Cpje_1) - Convert.ToInt32(list[i].Cpje_2)).ToString();
                        //    }
                        //    else if (list[i].Cpje_1 == "")
                        //    {
                        //        list[i].jc_je = (Convert.ToInt32(list[i].Cpje_3) + 0 - Convert.ToInt32(list[i].Cpje_2)).ToString();
                        //    }
                        //    else if (list[i].Cpje_2 == "")
                        //    {
                        //        list[i].jc_je = (Convert.ToInt32(list[i].Cpje_3) + Convert.ToInt32(list[i].Cpje_1) - 0).ToString();
                        //    }
                        //    else
                        //    {
                        //        list[i].jc_je = (Convert.ToInt32(list[i].Cpje_3) + Convert.ToInt32(list[i].Cpje_1) - Convert.ToInt32(list[i].Cpje_2)).ToString();
                        //    }
                        //}
                        //else
                        //{
                        //    list[i].jc_je = "0";
                        //}



                        if (Convert.ToInt32(list[i].jc_jc) > 0)
                        {
                            list[i].jc_dj = (Convert.ToInt32(list[i].jc_je) / Convert.ToInt32(list[i].jc_jc)).ToString();
                        }
                        else
                        {
                            list[i].jc_dj = "0";
                        }
                        list[i].yl_tx = "25";
                    }
                }
                List <zl_and_jc_info> jichu = can.select_jczl(Session["username"].ToString(), Session["gs_name"].ToString());
                shf.DataSource = jichu;
                shf.DataBind();
                ghs.DataSource = jichu;
                ghs.DataBind();
                spname.DataSource = jichu;
                spname.DataBind();
                fenlei.DataSource = jichu;
                fenlei.DataBind();
                Rep.DataSource = list;
                Rep.DataBind();
            }
        }
示例#5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string act = "";

            try
            {
                //if (!IsPostBack)
                //{
                List <ming_xi_info> list = new List <ming_xi_info>();

                act = Request["act"] == null ? "" : Request["act"].ToString();
                if (act.Equals("insert"))
                {
                    insert();
                }
                else if (act.Equals("update"))
                {
                    update();
                }
                else if (act.Equals("del"))
                {
                    del();
                }
                else if (act.Equals("Jiansuo"))
                {
                    list = selectWhere();
                }
                if (!act.Equals("Jiansuo") && Session["username"] != null && Session["gs_name"] != null)
                {
                    userid = Session["username"].ToString();
                    gongsi = Session["gs_name"].ToString();
                    list   = cal.ming_xi_select(Session["username"].ToString(), Session["gs_name"].ToString()).FindAll(fn => fn.Mxtype.Equals("入库"));

                    List <zl_and_jc_info> jichu = cal.select_jczl(Session["username"].ToString(), Session["gs_name"].ToString());
                    shangpingname.DataSource = jichu;
                    shangpingname.DataBind();
                    fenlei.DataSource = jichu;
                    fenlei.DataBind();
                    Gonghuofang.DataSource = jichu.FindAll(fd => !fd.Gong_huo.Equals("无") && !fd.Gong_huo.Equals(string.Empty));
                    Gonghuofang.DataBind();
                }
                //else
                //{
                //    return;
                //}
                Rep.DataSource = list;
                Rep.DataBind();
                //if (act.Equals("Jiansuo"))
                //{
                //    //var sb = new StringBuilder();
                //    //var sw = new StringWriter(sb);
                //    //HtmlTextWriter htw = new HtmlTextWriter(sw);
                //    //Rep.RenderControl(htw);
                //    //Response.Write(sb.ToString());
                //    //Response.End();
                //    //Response.Flush();
                //}
                //}
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (act.Equals("Jiansuo"))
                {
                    //Response.End();
                    //Response.Flush();
                }
            }
        }
    void Loaddata()
    {
        SqlParameter[] sqlParamSrh =
        {
            new SqlParameter("@MessageOut", SqlDbType.NVarChar, 200),
        };
        sqlParamSrh[0].Direction = ParameterDirection.Output;

        DataSet ds  = objSql.ExecuteDataset(CommandType.StoredProcedure, "NewReport", sqlParamSrh);
        string  msg = Convert.ToString(sqlParamSrh[0].Value);

        //
        //GvNReport.DataSource = ds;
        //GvNReport.DataBind();
        //GvNReport1.Caption = ds.Tables[1].Rows[0]["Today"].ToString();
        //GvNReport1.Caption = "<span style='background-color:#CCFFCC;font-size:small'>" + GvNReport1.Caption + "</span>";
        //GvNReport1.DataSource = ds.Tables[1];
        //GvNReport1.DataBind();

        ArrayList alst = new ArrayList();

        for (int i = 0; i < ds.Tables.Count; i++)
        {
            if (ds.Tables[i].Rows.Count > 0)
            {
                alst.Add(i);
            }
        }


        Rep.DataSource = alst;
        Rep.DataBind();

        //foreach (GridViewRow ctr in Rep.Rows)
        //{
        //    GridView gv = ctr.FindControl("GvNReport") as GridView;
        //    GridView gv1 = ctr.FindControl("GvNReport1") as GridView;
        //    if(gv != null)
        //    {
        //    gv.Caption = ds.Tables[0].Rows[0]["Today"].ToString();
        //    gv.Caption = "<span style='background-color:#CCFFCC;font-size:small'>" + gv.Caption + "</span>";
        //    gv.DataSource = ds;
        //    gv.DataBind();
        //    }
        //    if(gv1 != null)
        //    {
        //    gv1.Caption = ds.Tables[1].Rows[0]["Today"].ToString();
        //       gv1.Caption = "<span style='background-color:#CCFFCC;font-size:small'>" + gv1.Caption + "</span>";
        //    gv1.DataSource = ds.Tables[1];
        //    gv1.DataBind();
        //    }
        //}

        GridView  gv;
        DataTable dt;

        foreach (DataListItem dl in Rep.Items)
        {
            gv = dl.FindControl("GvNReport") as GridView;
            if (gv != null)
            {
                gv.DataSource = null;
                if (dl.ItemIndex > 6)
                {
                    return;
                }

                dt = ds.Tables[dl.ItemIndex];

                if (dt.Rows.Count > 0)
                {
                    gv.DataSource = dt;
                    gv.DataBind();
                    gv.Caption = dt.Rows[0]["Today"].ToString();
                    gv.Caption = "<span style='background-color:#CCFFCC;font-size:small;width:100%;'>" + gv.Caption + "</span>";

                    if (dl.ItemIndex == 0)
                    {
                        gv.Columns[3].Visible = false;
                    }
                    else if (Request.QueryString["flag"] != null)
                    {
                        if (dl.ItemIndex == Rep.Items.Count - 1)
                        {
                            gv.Columns[0].Visible = false;
                            gv.Columns[1].Visible = false;
                            gv.Columns[2].Visible = false;
                            gv.Columns[4].Visible = false;
                            gv.Columns[5].Visible = false;
                            gv.Columns[6].Visible = false;
                        }
                        else
                        {
                            gv.Columns[0].Visible = false;
                            gv.Columns[1].Visible = false;
                            gv.Columns[2].Visible = false;
                        }
                    }
                    else
                    {
                        gv.Columns[0].Visible = false;
                        gv.Columns[1].Visible = false;
                        gv.Columns[2].Visible = false;
                    }
                }
            }
        }
    }