コード例 #1
0
        public static string ListSeeds()
        {
            int    memberID = HttpContext.Current.Session["MemberID"].ToInt();
            var    info     = SeedProcess_Data.GetList(memberID, DateTime.Now);
            string result   = "";

            for (int i = 0; i < info.Rows.Count; i++)
            {
                DateTime StartTime = Convert.ToDateTime(info.Rows[i]["DateOfManufacture"]);
                DateTime EndTime   = new DateTime();
                if (info.Rows[i]["EndTime"].ToString() != "")
                {
                    EndTime = Convert.ToDateTime(info.Rows[i]["EndTime"]);
                }
                //if (EndTime > DateTime.Now)
                {
                    result += @"<table data-toggle='table' data-url='data1.json' data-cache='false' data-height='299' style='margin-bottom: -10px;margin-top: -10px;'>
                        <thead>
                            <tr>
                                <th class='col-sm-2'><img src='" + info.Rows[i]["Images"].ToString().Replace("..", "http://admin.vietgap.info") + "' style='width:80px;height:80px'/></th>" +
                              "<th class='col-sm-10'><font color='rgb(87, 7, 65)'>" + info.Rows[i]["SeedsName"] + "</font><br />Ngày trồng &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: <b>" + StartTime.ToString("dd-MM-yyyy") + "</b><br />Ngày thu hoạch: <b>" + EndTime.ToString("dd-MM-yyyy") + "</b></th>" +
                              @"</tr>
                        </thead>
                        </table><hr/>";
                }
            }


            return(result);
        }
コード例 #2
0
ファイル: SeedProcess.aspx.cs プロジェクト: DHLONGAN/VietGAP
        protected void GrDelete(object sender, CommandEventArgs e)
        {
            int nPageNumber             = int.Parse(txtPageNumber.Text);
            int nPageSize               = int.Parse(txtPageSize.Text);
            SessionUserLogin nUserLogin = (SessionUserLogin)Session["UserLogin"];

            nUserLogin.CheckRole("CU0001");
            if (!nUserLogin.Role.Del)
            {
                Response.Write("<script >alert('Bạn không có quyền xóa danh mục này!')</script>");
            }
            else
            {
                try
                {
                    int             mKey = int.Parse(e.CommandArgument.ToString());
                    SeedProces_Info info = new SeedProces_Info(mKey);
                    info.Delete();
                    DataTable nTable = SeedProcess_Data.GetList(Convert.ToInt16(Session["EmployeeKey"]), nPageSize, nPageNumber, DDLSeeds.SelectedValue.ToInt());
                    if (nTable.Rows.Count == 0)
                    {
                        nTable.Rows.Add(0, 0, "", 0, 0, 0, "", "", 0, "", "", "", 0, 0, null, null, 0, 0, 0, "", 0, 0, "", "", "", 0, "");
                    }
                    GV_SeedProcess.DataSource = nTable;
                    GV_SeedProcess.DataBind();
                    LoadPages();
                }
                catch
                {
                    Response.Write("<script >alert('Có lỗi gì đó vui lòng thử lại!')</script>");
                }
            }
        }
コード例 #3
0
ファイル: SeedProcess.aspx.cs プロジェクト: DHLONGAN/VietGAP
        protected void cmdView_Click1(object sender, ImageClickEventArgs e)
        {
            txtPageNumber.Text = "1";
            int nPageNumber             = int.Parse(txtPageNumber.Text);
            int nPageSize               = int.Parse(txtPageSize.Text);
            SessionUserLogin nUserLogin = (SessionUserLogin)Session["UserLogin"];
            DateTime         dtfrom     = DateTime.ParseExact(txtfromDatetime.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            DateTime         dtto       = DateTime.ParseExact(txttoDatetime.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            DataTable        nTable     = SeedProcess_Data.GetList(dtfrom, dtto, Convert.ToInt16(Session["EmployeeKey"]), nPageSize, nPageNumber, DDLSeeds.SelectedValue.ToInt());

            GV_SeedProcess.DataSource = nTable;
            GV_SeedProcess.DataBind();
            LoadPages();
        }
コード例 #4
0
        public static string Listwork(string time)
        {
            string result   = "";
            int    memberID = HttpContext.Current.Session["MemberID"].ToInt();
            var    infos    = SeedProcess_Data.GetList(time, memberID);

            if (infos.Rows.Count > 0)
            {
                for (int i = 0; i < infos.Rows.Count; i++)
                {
                    result += "$" + infos.Rows[i]["SeedProcessKey"].ToString() + "-" + infos.Rows[i]["SeedsName"].ToString();
                }
            }
            return(result);
        }
コード例 #5
0
ファイル: SeedProcess.aspx.cs プロジェクト: DHLONGAN/VietGAP
        private void LoadData()
        {
            int nPageNumber             = int.Parse(txtPageNumber.Text);
            int nPageSize               = int.Parse(txtPageSize.Text);
            SessionUserLogin nUserLogin = (SessionUserLogin)Session["UserLogin"];
            DataTable        nTable     = SeedProcess_Data.GetList(Convert.ToInt16(Session["EmployeeKey"]), nPageSize, nPageNumber, DDLSeeds.SelectedValue.ToInt());

            if (nTable.Rows.Count == 0)
            {
                nTable.Rows.Add(0, 0, "", 0, 0, 0, "", "", 0, "", "", "", 0, 0, null, null, 0, 0, 0, "", 0, 0, "", "", "", 0, "");
            }
            GV_SeedProcess.DataSource = nTable;
            GV_SeedProcess.DataBind();
            txtfromDatetime.Text = "01/" + DateTime.Now.ToString("MM/yyyy");
            txttoDatetime.Text   = DateTime.Now.ToString("dd/MM/yyyy");
            LoadPages();
        }