Ejemplo n.º 1
0
        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"];
            DataTable        nTable     = new DataTable();

            switch (nUserLogin.GroupKey.ToInt())
            {
            case 2:
            {
                nTable = TimeLimit_Cooperative_Data.GetList(nPageSize, nPageNumber, txtSearch.Text, nUserLogin.CooperativeKey, nUserLogin.GroupKey);
                break;
            }

            case 3:
            {
                nTable = TimeLimit_Cooperative_Data.GetList(nPageSize, nPageNumber, txtSearch.Text, nUserLogin.CooperativeVenturesKey, nUserLogin.GroupKey);
                break;
            }

            case 4:
            {
                goto case 3;
            }
            }
            if (nTable.Rows.Count == 0)
            {
                nTable.Rows.Add(0, 0, "", 0);
            }
            GV_List.DataSource = nTable;
            GV_List.DataBind();
            LoadPages();
        }
Ejemplo n.º 2
0
 protected void btnBack_Click(object sender, EventArgs e)
 {
     Session["IpList"]  = null;
     GV_List.DataSource = null;
     GV_List.DataBind();
     BackEvent(sender, e);
 }
Ejemplo n.º 3
0
    void FillListVehicle()
    {
        SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["eChallanConnectionString2"].ToString());

        try
        {
            con.Open();

            SqlCommand cmd = new SqlCommand("ShowRegdVehicle", con);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;

            cmd.Parameters.Add("@FLD", System.Data.SqlDbType.VarChar, 50).Value = ddlRegd.SelectedItem.Text;
            cmd.Parameters.Add("@VAL", System.Data.SqlDbType.VarChar, 50).Value = txtSearchGrid.Text;

            SqlDataReader dr;
            dr = cmd.ExecuteReader();

            GV_List.DataSource = dr;
            GV_List.DataBind();

            dr.Close();
            con.Close();
        }

        catch (Exception ex)
        {
            lblMsg.Text      = ex.Message;
            lblMsg.ForeColor = Color.Red;
        }
    }
Ejemplo n.º 4
0
    public void ListView(object sender)
    {
        string        region    = (string)(((object[])sender)[0]);
        string        flowCode  = (string)(((object[])sender)[1]);
        DateTime      date      = (DateTime)(((object[])sender)[2]);
        string        code      = (string)(((object[])sender)[3]);
        string        itemCode  = (string)(((object[])sender)[4]);
        IList <Shift> shiftList = (IList <Shift>)(((object[])sender)[5]);

        if (shiftList != null && shiftList.Count > 0)
        {
            shiftIdList = new List <string>();
            foreach (Shift shift in shiftList)
            {
                shiftIdList.Add(shift.Code);
            }
        }

        IList <ShiftPlanSchedule> spsList = TheShiftPlanScheduleMgr.GetShiftPlanScheduleList(region, flowCode, date, code, itemCode, this.CurrentUser.Code);
        DataTable dt = TheShiftPlanScheduleMgr.ConvertShiftPlanScheduleToDataTable(spsList, shiftList);

        GV_List.DataSource = dt;
        GV_List.DataBind();

        this.HideColumns(shiftList);
    }
Ejemplo n.º 5
0
        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("CU0002");
            //if (!nUserLogin.Role.Del)W
            //{
            //    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());
                    TimeLimit_Cooperative_Info info = new TimeLimit_Cooperative_Info(mKey);
                    //if ((DateTime.Now - info.CreatedDateTime).TotalDays > 7)
                    //{
                    //    Response.Write("<script >alert('Dữ liệu đã quá 7 ngày, không được phép xóa!')</script>");
                    //}
                    //else
                    {
                        info.Delete();
                        DataTable nTable = new DataTable();
                        switch (nUserLogin.GroupKey.ToInt())
                        {
                        case 2:
                        {
                            nTable = TimeLimit_Cooperative_Data.GetList(nPageSize, nPageNumber, txtSearch.Text, nUserLogin.CooperativeKey, nUserLogin.GroupKey);
                            break;
                        }

                        case 3:
                        {
                            nTable = TimeLimit_Cooperative_Data.GetList(nPageSize, nPageNumber, txtSearch.Text, nUserLogin.CooperativeVenturesKey, nUserLogin.GroupKey);
                            break;
                        }

                        case 4:
                        {
                            goto case 3;
                        }
                        }
                        if (nTable.Rows.Count == 0)
                        {
                            nTable.Rows.Add(0, 0, "", 0);
                        }
                        GV_List.DataSource = nTable;
                        GV_List.DataBind();
                        LoadPages();
                    }
                }
                catch
                {
                    Response.Write("<script >alert('Có lỗi gì đó vui lòng thử lại!')</script>");
                }
            }
        }
Ejemplo n.º 6
0
 public void Export()
 {
     if (GV_List.FindPager().RecordCount > 0)
     {
         GV_List.Columns.RemoveAt(GV_List.Columns.Count - 1);
     }
     this.ExportXLS(GV_List, "ReceiptNotes.xls");
 }
Ejemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Session["IpList"]  = null;
         GV_List.DataSource = null;
         GV_List.DataBind();
     }
 }
Ejemplo n.º 8
0
    protected void lbtnDel_Click(object sender, EventArgs e)
    {
        if (Session["IpList"] != null)
        {
            IList <InProcessLocation> ipl = (IList <InProcessLocation>)Session["IpList"];

            string            ipNo = ((System.Web.UI.WebControls.LinkButton)sender).CommandArgument;
            InProcessLocation ip   = TheInProcessLocationMgr.LoadInProcessLocation(ipNo);
            ipl.Remove(ip);
            GV_List.DataSource = ipl;
            GV_List.DataBind();
            Session["IpList"] = ipl;
        }
    }
Ejemplo n.º 9
0
        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"];
            DataTable        nTable     = ProcessPlantDetail_Data.GetList(nPageSize, nPageNumber, txtSearch.Text, _key);

            if (nTable.Rows.Count == 0)
            {
                nTable.Rows.Add(0, 0, "", 0);
            }
            GV_List.DataSource = nTable;
            GV_List.DataBind();
            LoadPages();
        }
Ejemplo n.º 10
0
        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"];
            DataTable        nTable     = Process_LandUse_Data.GetList(nPageSize, nPageNumber, txtSearch.Text, Session["CooperativeKey"].ToInt());

            if (nTable.Rows.Count == 0)
            {
                nTable.Rows.Add("", 0, 0, "", "");
            }
            GV_List.DataSource = nTable;
            GV_List.DataBind();
            LoadPages();
        }
Ejemplo n.º 11
0
    public void Export()
    {
        string dateTime = DateTime.Now.ToString("ddhhmmss");

        this.isExport = true;
        if (isGroup)
        {
            if (GV_List.FindPager().RecordCount > 0)
            {
                GV_List.Columns.RemoveAt(GV_List.Columns.Count - 1);
            }
            this.ExportXLS(GV_List, "ProcurementGroup" + dateTime + ".xls");
        }
        else
        {
            this.ExportXLS(GV_List_Detail, "ProcurementDetail" + dateTime + ".xls");
        }
    }
Ejemplo n.º 12
0
        public void LoadData()
        {
            int nPageNumber             = int.Parse(txtPageNumber.Text);
            int nPageSize               = int.Parse(txtPageSize.Text);
            SessionUserLogin nUserLogin = (SessionUserLogin)Session["UserLogin"];
            DataTable        nTable     = Process_LandUse_Data.GetList(nPageSize, nPageNumber, txtSearch.Text, Session["CooperativeKey"].ToInt());

            if (nTable.Rows.Count == 0)
            {
                nTable.Rows.Add("", 0, 0, "", "");
            }
            nTable.Columns.Add();
            GV_List.DataSource = nTable;
            GV_List.DataBind();
            DateTime dt = DateTime.Now;

            LoadPages();
        }
Ejemplo n.º 13
0
    private void Export()
    {
        string dateTime = DateTime.Now.ToString("ddhhmmss");

        if (ListType == 0)
        {
            if (GV_List.FindPager().RecordCount > 0)
            {
                GV_List.Columns.RemoveAt(GV_List.Columns.Count - 1);
            }
            this.ExportXLS(GV_List, "PickListGroup" + dateTime + ".xls");
        }
        else if (ListType == 1)
        {
            this.ExportXLS(GV_Detail, "PickListDetail" + dateTime + ".xls");
        }
        else if (ListType == 2)
        {
            this.ExportXLS(GV_Result, "PickListResult" + dateTime + ".xls");
        }
    }
Ejemplo n.º 14
0
    public override void UpdateView()
    {
        if (!isExport)
        {
            if (isGroup)
            {
                this.GV_List.Execute();
                this.GV_List.Visible        = true;
                this.gp.Visible             = true;
                this.GV_List_Detail.Visible = false;
                this.gp_Detail.Visible      = false;
            }
            else
            {
                this.GV_List_Detail.Execute();
                this.GV_List.Visible        = false;
                this.GV_List_Detail.Visible = true;
                this.gp.Visible             = false;
                this.gp_Detail.Visible      = true;
                HiddenColumns(this.GV_List_Detail);
            }
        }
        else
        {
            string dateTime = DateTime.Now.ToString("ddhhmmss");

            if (isGroup)
            {
                if (GV_List.FindPager().RecordCount > 0)
                {
                    GV_List.Columns.RemoveAt(GV_List.Columns.Count - 1);
                }
                this.ExportXLS(GV_List, "ProductionGroup" + dateTime + ".xls");
            }
            else
            {
                this.ExportXLS(GV_List_Detail, "ProductionDetail" + dateTime + ".xls");
            }
        }
    }
Ejemplo n.º 15
0
        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("CU0002");
            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());
                    Process_LandUse_Info info = new Process_LandUse_Info(mKey);
                    if ((DateTime.Now - info.CreatedDateTime).TotalDays > 7)
                    {
                        Response.Write("<script >alert('Dữ liệu đã quá 7 ngày, không được phép xóa!')</script>");
                    }
                    else
                    {
                        info.Delete();
                        DataTable nTable = Process_LandUse_Data.GetList(nPageSize, nPageNumber, txtSearch.Text, Session["CooperativeKey"].ToInt());
                        if (nTable.Rows.Count == 0)
                        {
                            nTable.Rows.Add("", 0, 0, "", "");
                        }
                        GV_List.DataSource = nTable;
                        GV_List.DataBind();
                        LoadPages();
                    }
                }
                catch
                {
                    Response.Write("<script >alert('Có lỗi gì đó vui lòng thử lại!')</script>");
                }
            }
        }
Ejemplo n.º 16
0
 protected void btnConfirm_Click(object sender, EventArgs e)
 {
     if (IpNo.Text != string.Empty)
     {
         IList <InProcessLocation> ipl = new List <InProcessLocation>();
         if (Session["IpList"] != null)
         {
             ipl = (IList <InProcessLocation>)Session["IpList"];
         }
         DetachedCriteria selectCriteria = DetachedCriteria.For(typeof(InProcessLocation));
         selectCriteria.Add(Expression.Like("IpNo", IpNo.Text.Trim(), MatchMode.End));
         selectCriteria.Add(Expression.Eq("PartyFrom.Code", "YFK-FG"));
         IList <InProcessLocation> result = TheCriteriaMgr.FindAll <InProcessLocation>(selectCriteria);
         if (result.Count == 0)
         {
             ShowWarningMessage("InProcessLocation.UnLoad.Warning", IpNo.Text.Trim());
         }
         int cnt = ipl.Count;
         foreach (InProcessLocation i in result)
         {
             if (checkIsExist(ipl, i.IpNo) == true)
             {
                 continue;
             }
             if (i.CurrentActivity == null)
             {
                 ipl.Add(i);
             }
         }
         if (cnt == ipl.Count)
         {
             ShowWarningMessage("InProcessLocation.UnLoad.Warning", IpNo.Text.Trim());
         }
         GV_List.DataSource = ipl;
         GV_List.DataBind();
         Session["IpList"] = ipl;
         TheCriteriaMgr.CleanSession();
     }
 }
Ejemplo n.º 17
0
        public void LoadData()
        {
            int nPageNumber             = int.Parse(txtPageNumber.Text);
            int nPageSize               = int.Parse(txtPageSize.Text);
            SessionUserLogin nUserLogin = (SessionUserLogin)Session["UserLogin"];
            DataTable        nTable     = ProcessPlantDetail_Data.GetList(nPageSize, nPageNumber, txtSearch.Text, _key);

            if (_key != 0)
            {
                ProcessPlant_Info info = new ProcessPlant_Info(_key);
                Session["ProcessPlant_Type"] = info.ProcessPlant_Type;
            }
            if (nTable.Rows.Count == 0)
            {
                nTable.Rows.Add(0, 0, "", 0);
            }
            nTable.Columns.Add();
            GV_List.DataSource = nTable;
            GV_List.DataBind();
            DateTime dt = DateTime.Now;

            LoadPages();
        }
Ejemplo n.º 18
0
        public void LoadData()
        {
            int nPageNumber             = int.Parse(txtPageNumber.Text);
            int nPageSize               = int.Parse(txtPageSize.Text);
            SessionUserLogin nUserLogin = (SessionUserLogin)Session["UserLogin"];
            DataTable        nTable     = new DataTable();

            switch (nUserLogin.GroupKey.ToInt())
            {
            case 2:
            {
                nTable = TimeLimit_Cooperative_Data.GetList(nPageSize, nPageNumber, txtSearch.Text, nUserLogin.CooperativeKey, nUserLogin.GroupKey);
                break;
            }

            case 3:
            {
                nTable = TimeLimit_Cooperative_Data.GetList(nPageSize, nPageNumber, txtSearch.Text, nUserLogin.CooperativeVenturesKey, nUserLogin.GroupKey);
                break;
            }

            case 4:
            {
                goto case 3;
            }
            }
            if (nTable.Rows.Count == 0)
            {
                nTable.Rows.Add(0, 0, "", 0);
            }
            nTable.Columns.Add();
            GV_List.DataSource = nTable;
            GV_List.DataBind();
            DateTime dt = DateTime.Now;

            LoadPages();
        }
Ejemplo n.º 19
0
 protected void btnBatchCon_Click(object sender, EventArgs e)
 {
     if (Session["IpList"] != null)
     {
         IList <InProcessLocation> ipl = (IList <InProcessLocation>)Session["IpList"];
         if (ipl.Count == 0)
         {
             ShowErrorMessage("InProcessLocation.DetailEmpty.Error");
             return;
         }
         foreach (InProcessLocation i in ipl)
         {
             if (i.CurrentActivity == null)
             {
                 i.CurrentActivity = CurrentUser.Code + "|" + DateTime.Now.ToString("yyMMddHHmmss");
             }
             TheInProcessLocationMgr.UpdateInProcessLocation(i);
         }
         Session["IpList"]  = null;
         GV_List.DataSource = null;
         GV_List.DataBind();
         ShowSuccessMessage("InProcessLocation.BatchConfirm.Successfully");
     }
 }