protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Page.ClientScript.RegisterClientScriptInclude("jquery", ResolveUrl("~/js/jquery.js"));
                if (!IsPostBack)
                {
                    if (Request.QueryString["IDCaSau"] != null)
                    {
                        int       IDCaSau           = int.Parse(Request.QueryString["IDCaSau"]);
                        DataTable tblChiTiet        = csCont.LoadCaSauHienTaiByID(IDCaSau);
                        DataTable tblBienDong       = csCont.LoadCaSauBienDong(IDCaSau);
                        DataTable tblBienDongDelete = csCont.LoadCaSauBienDong_Delete(IDCaSau);
                        DataTable tblSinhSan        = csCont.LoadTheoDoiDeByIDCaSau(IDCaSau);
                        grvChiTiet.DataSource = tblChiTiet;
                        grvChiTiet.DataBind();
                        grvDanhSach.DataSource = tblBienDong;
                        grvDanhSach.DataBind();
                        if (tblBienDongDelete.Rows.Count > 0)
                        {
                            lblBienDongXoa.Text       = "BIẾN ĐỘNG ĐÃ XÓA";
                            lblBienDongXoa.Visible    = true;
                            grvDanhSachXoa.DataSource = tblBienDongDelete;
                            grvDanhSachXoa.DataBind();
                        }
                        if (tblSinhSan.Rows.Count > 0)
                        {
                            lblSinhSan.Text       = "THỐNG KÊ SINH SẢN";
                            lblSinhSan.Visible    = true;
                            grvSinhSan.DataSource = tblSinhSan;
                            grvSinhSan.DataBind();
                        }

                        if (!UserInfo.IsSuperUser && !UserInfo.IsInRole("Administrators") && !CaSauController.HasEditPermission(UserInfo.Roles, "KhoaCS"))
                        {
                            btnKhoa.Visible   = false;
                            btnMoKhoa.Visible = false;
                            grvDanhSach.Columns[5].Visible = false;
                        }

                        if (!UserInfo.IsSuperUser && !UserInfo.IsInRole("Administrators") && !CaSauController.HasEditPermission(UserInfo.Roles, "QLCS"))
                        {
                            grvDanhSach.Columns[6].Visible = false;
                            grvDanhSach.Columns[7].Visible = false;
                        }
                        if (tblChiTiet.Rows.Count > 0)
                        {
                            txtGhiChu.Text = tblChiTiet.Rows[0]["GhiChu"].ToString();
                        }
                    }
                    hdListBienDongPage.Value = t.GetTabByName(ConfigurationManager.AppSettings["QLCS_CaSauListBienDongPage"], PortalId).TabID.ToString();
                }
            }
            catch (Exception ex)
            {
            }
        }
        private static void AddUniqueUrlToIndex(string furlKey, ref string qsKey, string qsValue, int portalId, Hashtable queryStringIndex, FriendlyUrlOptions options, bool addSuffixIfDuplicateFound, out string suffix)
        {
            DotNetNuke.Entities.Tabs.TabController tc = new DotNetNuke.Entities.Tabs.TabController();
            bool duplicate = false;

            suffix = "";//can hold a de-duplicating suffix
            int  suffixCounter = 1;
            bool furlKeyUsed   = false;

            do
            {
                duplicate = false;//always start in the assumption that this is not a duplicate
                DotNetNuke.Entities.Tabs.TabInfo matchingTab = tc.GetTabByName(qsKey, portalId);
                if (matchingTab != null)
                {
                    duplicate = true;
                }
                else
                if (portalId >= 0)
                {
                    matchingTab = tc.GetTabByName(qsKey, -1);    //host tabs
                    if (matchingTab != null)
                    {
                        duplicate = true;
                    }
                }

                if (duplicate == false)
                {
                    //try and add to index
                    if (queryStringIndex.ContainsKey(qsKey) == false)
                    {
                        queryStringIndex.Add(qsKey, qsValue);
                    }
                    else
                    {
                        duplicate = true;
                    }
                }
                if (duplicate == true)
                {
                    if (furlKeyUsed == false)
                    {
                        furlKeyUsed = true;
                        suffix      = options.PunctuationReplacement + furlKey;
                        qsKey      += suffix;
                    }
                    else
                    {
                        suffix += suffixCounter.ToString();
                        qsKey  += suffix;
                    }
                }
            }while (duplicate == true && addSuffixIfDuplicateFound == true);
        }
Exemplo n.º 3
0
        /// <summary>
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    IInviteRepository _repository = new InviteRepository();
                    _invitations = _repository.GetUserInvites(UserId, DateTime.MinValue).ToList();

                    DotNetNuke.Entities.Tabs.TabController tCtrl = new DotNetNuke.Entities.Tabs.TabController();
                    var activityTab = tCtrl.GetTabByName("Activity Feed", PortalId, -1);
                    if (activityTab != null)
                    {
                        UserProfileTabId = activityTab.TabID;
                    }

                    var mCtrl = new DotNetNuke.Entities.Modules.ModuleController();
                    ModuleName = mCtrl.GetModule(base.ModuleId).DesktopModule.ModuleName;
                }
                DotNetNuke.Framework.ServicesFramework.Instance.RequestAjaxScriptSupport();
                DotNetNuke.Framework.ServicesFramework.Instance.RequestAjaxAntiForgerySupport();
            }
            catch (Exception exc) //Module failed to load
            {
                DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
        protected void btnXemThayDoi_Click(object sender, EventArgs e)
        {
            DotNetNuke.Entities.Tabs.TabController t = new DotNetNuke.Entities.Tabs.TabController();
            int CaSauAnThuocLichSuPage = t.GetTabByName(ConfigurationManager.AppSettings["QLCS_CaSauAnThuocLichSuPage"], PortalId).TabID;

            Page.ClientScript.RegisterStartupScript(typeof(string), "fail", "<script language=javascript>openwindow('" + DotNetNuke.Common.Globals.NavigateURL(CaSauAnThuocLichSuPage, "", "status/" + ((Button)sender).CommandName, "IDCaSauAnThuoc/" + ((Button)sender).CommandArgument) + "','',1000,600);</script>", false);
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    Page.ClientScript.RegisterClientScriptInclude("jquery", ResolveUrl("~/js/jquery.js"));
                    DotNetNuke.Entities.Tabs.TabController t = new DotNetNuke.Entities.Tabs.TabController();
                    hdVatTuBienDongPage.Value = t.GetTabByName(ConfigurationManager.AppSettings["QLCS_VatTuBienDongPage"], PortalId).TabID.ToString();

                    if (!UserInfo.IsSuperUser && !UserInfo.IsInRole("Administrators") && !CaSauController.HasEditPermission(UserInfo.Roles, "QLCS"))
                    {
                        lnkAddNew.Visible = false;
                    }
                    if (Settings["LoaiVatTu"] != null)
                    {
                        ddlLoaiVatTu.SelectedValue = Settings["LoaiVatTu"].ToString();
                    }
                    lnkAddNew.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "vattu_addnew", "mid/" + this.ModuleId.ToString(), "loaivattu/" + ddlLoaiVatTu.SelectedValue);
                    scale = int.Parse(ConfigurationManager.AppSettings["QLCS_VatTu_" + ddlLoaiVatTu.SelectedValue + "_Scale"]);
                    btnLoad_Click(null, null);
                }
                else
                {
                    scale = int.Parse(ConfigurationManager.AppSettings["QLCS_VatTu_" + ddlLoaiVatTu.SelectedValue + "_Scale"]);
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
Exemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Page.ClientScript.RegisterClientScriptInclude("jquery", ResolveUrl("~/js/jquery.js"));
         string VTGM     = ConfigurationManager.AppSettings["QLCS_VatTuGietMo"];
         string VTGMText = ConfigurationManager.AppSettings["QLCS_VatTuGietMoText"];
         if (VTGM != "" && VTGM != null)
         {
             string[] aVTGM     = VTGM.Substring(1, VTGM.Length - 2).Split(new string[] { "@@" }, StringSplitOptions.RemoveEmptyEntries);
             string[] aVTGMText = VTGMText.Substring(1, VTGMText.Length - 2).Split(new string[] { "@@" }, StringSplitOptions.RemoveEmptyEntries);
             for (int i = 0; i < aVTGM.Length; i++)
             {
                 dicVatTu.Add(aVTGM[i], aVTGMText[i]);
             }
         }
         if (!IsPostBack)
         {
             if (Request.QueryString["gmcid"] != null)
             {
                 lblGMC.Text = Request.QueryString["gmcid"];
                 DotNetNuke.Entities.Tabs.TabController t = new DotNetNuke.Entities.Tabs.TabController();
                 hdGietMoCaChonCaPage.Value = t.GetTabByName(ConfigurationManager.AppSettings["QLCS_GietMoCaChonCaPage"], PortalId).TabID.ToString();
                 btnAddGietMoCaChiTiet.Attributes["onclick"] = "openwindow('" + DotNetNuke.Common.Globals.NavigateURL(int.Parse(hdGietMoCaChonCaPage.Value), "", "gietmoca/" + lblGMC.Text) + "','',900,600);";
                 btnAddGietMoCaChiTiet.Attributes["style"]   = "cursor:pointer;font-weight:bold;";
                 LoadData();
             }
             lnkCancel.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "gietmoca_edit", "mid/" + this.ModuleId.ToString(), "gmcid/" + Request.QueryString["gmcid"]);
         }
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
 }
Exemplo n.º 7
0
        /// <summary>
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                _settings              = new SettingsRepository(base.ModuleContext.ModuleId, base.ModuleContext.TabModuleId);
                DefaultMessage         = System.Web.HttpUtility.JavaScriptStringEncode(_settings.DefaultMessage);
                MaxEmailInputs         = _settings.MaxEmailInvitesPerSubmit;
                MaxDailyInvites        = _settings.MaxEmailInvitesPerDay;
                pnlUserMessage.Visible = _settings.ShowMessageToUser;

                if (!IsPostBack)
                {
                    DotNetNuke.Entities.Tabs.TabController tCtrl = new DotNetNuke.Entities.Tabs.TabController();
                    var activityTab = tCtrl.GetTabByName("Activity Feed", PortalId, -1);
                    if (activityTab != null)
                    {
                        UserProfileTabId = activityTab.TabID;
                    }

                    var mCtrl = new DotNetNuke.Entities.Modules.ModuleController();
                    ModuleName = mCtrl.GetModule(base.ModuleId).DesktopModule.ModuleName;

                    lnkCloseModal.Visible = IsModal;

                    IInviteRepository inviteRepo = new InviteRepository();
                    DailyInviteCount = inviteRepo.GetUserInvites(base.UserId, DateTime.Today).Count();
                }
                DotNetNuke.Framework.ServicesFramework.Instance.RequestAjaxScriptSupport();
                DotNetNuke.Framework.ServicesFramework.Instance.RequestAjaxAntiForgerySupport();
            }
            catch (Exception exc) //Module failed to load
            {
                DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Exemplo n.º 8
0
        protected void btnXemThayDoi_Click(object sender, EventArgs e)
        {
            DotNetNuke.Entities.Tabs.TabController t = new DotNetNuke.Entities.Tabs.TabController();
            int ThuHoiDaLichSuPage = t.GetTabByName(ConfigurationManager.AppSettings["QLCS_ThuHoiDaLichSuPage"], PortalId).TabID;

            //Session["EditBienDongCaSauParam"] = ((Button)sender).CommandArgument;
            Page.ClientScript.RegisterStartupScript(typeof(string), "fail", "<script language=javascript>openwindow('" + DotNetNuke.Common.Globals.NavigateURL(ThuHoiDaLichSuPage, "", "status/" + ddlRowStatus.SelectedValue, "IDThuHoiDa/" + ((Button)sender).CommandArgument) + "','',800,400);</script>", false);
        }
 protected void btnXemSPThuHoiXoa_Click(object sender, EventArgs e)
 {
     if (((Button)sender).CommandName == "chet")
     {
         DotNetNuke.Entities.Tabs.TabController t = new DotNetNuke.Entities.Tabs.TabController();
         int ThuHoiDaLichSuPage = t.GetTabByName(ConfigurationManager.AppSettings["QLCS_ThuHoiDaLichSuPage"], PortalId).TabID;
         Page.ClientScript.RegisterStartupScript(typeof(string), "fail", "<script language=javascript>openwindow('" + DotNetNuke.Common.Globals.NavigateURL(ThuHoiDaLichSuPage, "", "status/0", "IDThuHoiDa/" + csCont.ThuHoiDa_GetIDByCa(int.Parse(Request.QueryString["IDCaSau"]), 0)) + "','',800,400);</script>", false);
     }
 }
Exemplo n.º 10
0
        protected void gvTeamsView_OnRowCommand(object sender, GridViewCommandEventArgs e)
        {
            int team_ID = 0;

            int.TryParse(e.CommandArgument.ToString(), out team_ID);
            if (e.CommandName.Equals("teamName"))
            {
                tInfo1 = tabs1.GetTabByName("Teams", PortalId);
                Response.Redirect(Globals.NavigateURL(tInfo1.TabID, "", "mctl=" + "conTeamAllDetail", "TeamID=" + team_ID));
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Page.ClientScript.RegisterClientScriptInclude("jquery", ResolveUrl("~/js/jquery.js"));
                if (!IsPostBack)
                {
                    DataTable dtLoaiCa = csCont.LoadLoaiCa(1);
                    ddlLoaiCa.DataSource     = dtLoaiCa;
                    ddlLoaiCa.DataTextField  = "TenLoaiCa";
                    ddlLoaiCa.DataValueField = "IDLoaiCa";
                    ddlLoaiCa.DataBind();
                    ddlLoaiCa.Items.Insert(0, new ListItem("-----", "0"));

                    DataTable dtChuong = csCont.LoadChuong(1);
                    ddlChuong.DataSource     = dtChuong;
                    ddlChuong.DataTextField  = "Chuong";
                    ddlChuong.DataValueField = "IDChuong";
                    ddlChuong.DataBind();
                    ddlChuong.Items.Insert(0, new ListItem("-----", "0"));

                    DataTable dtCaMe = csCont.LoadCaSauMe_AllTrangThai();
                    ddlCaMe.DataSource     = dtCaMe;
                    ddlCaMe.DataTextField  = "CaMe";
                    ddlCaMe.DataValueField = "IDCaSau";
                    ddlCaMe.DataBind();
                    ddlCaMe.Items.Insert(0, new ListItem("-----", "0"));

                    if (Session["AutoDisplay_CSBan"] != null && Convert.ToBoolean(Session["AutoDisplay_CSBan"]))
                    {
                        txtMaSo.Text = Session["CSBan_MaSo"].ToString();
                        ddlGioiTinh.SelectedValue = Session["CSBan_GioiTinh"].ToString();
                        ddlLoaiCa.SelectedValue   = Session["CSBan_LoaiCa"].ToString();
                        ddlChuong.SelectedValue   = Session["CSBan_Chuong"].ToString();
                        ddlCaMe.SelectedValue     = Session["CSBan_CaMe"].ToString();
                        btnLoad_Click(null, null);
                    }

                    if (!UserInfo.IsSuperUser && !UserInfo.IsInRole("Administrators") && !CaSauController.HasEditPermission(UserInfo.Roles, "QLCS"))
                    {
                        btnPhucHoi.Visible = false;
                        tdSub.Visible      = false;
                    }
                    DotNetNuke.Entities.Tabs.TabController t = new DotNetNuke.Entities.Tabs.TabController();
                    hdListBienDongPage.Value = t.GetTabByName(ConfigurationManager.AppSettings["QLCS_CaSauListBienDongPage"], PortalId).TabID.ToString();
                }
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         DotNetNuke.Entities.Tabs.TabController tabCont = new DotNetNuke.Entities.Tabs.TabController();
         DotNetNuke.Entities.Tabs.TabInfo       tab     = tabCont.GetTabByName(UserInfo.Profile.IM, PortalId);
         if (tab != null && tab.TabID != null)
         {
             Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(tab.TabID));
         }
     }
     catch (Exception ex)
     {
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     ci = System.Globalization.CultureInfo.CreateSpecificCulture(UserInfo.Profile.PreferredLocale);
     try
     {
         if (!Page.IsPostBack)
         {
             BindControls();
         }
         DotNetNuke.Entities.Tabs.TabController t = new DotNetNuke.Entities.Tabs.TabController();
         hdListBienDongPage.Value = t.GetTabByName(ConfigurationManager.AppSettings["QLCS_CaSauListBienDongPage"], PortalId).TabID.ToString();
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
 }
Exemplo n.º 14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Page.ClientScript.RegisterClientScriptInclude("jquery", ResolveUrl("~/js/jquery.js"));
         Control c = DotNetNuke.Common.Globals.FindControlRecursiveDown(Page, "ScriptManager");
         if (c != null)
         {
             ((ScriptManager)c).RegisterPostBackControl(btnSaveNoiDung);
         }
         if (!Page.IsPostBack)
         {
             ChangeStatusPage = t.GetTabByName(ConfigurationManager.AppSettings["NhanHieu_ChangeStatusPage"], PortalId).TabID;
             if (UserInfo.Profile.Website != null)
             {
                 website = UserInfo.Profile.Website;
             }
             LoadEditControl();
             if (Request.QueryString["ID"] != null)
             {
                 SetNhanHieuID(Request.QueryString["ID"]);
                 LoadData();
             }
             else
             {
                 trCurrentFile.Visible = false;
                 lblChooseFile.Text    = "Chọn hình";
                 SetNhanHieuID("0");
             }
             SetButtonStatus();
         }
     }
     catch (Exception ex)
     {
     }
 }
		protected override void OnLoad (EventArgs e)
		{
			base.OnLoad (e);

			if (UserInfo.IsSuperUser)
			{
				lnkEditLists.Text = Localization.GetString ("lnkEditLists", base.LocalResourceFile);

				//lnkEditLists.Target = "_blank"

				try
				{
					var _with7 = new DotNetNuke.Entities.Tabs.TabController ();
					lnkEditLists.NavigateUrl = _with7.GetTabByName ("Lists", DotNetNuke.Common.Utilities.Null.NullInteger).FullUrl;
				}
				catch
				{
					//Unable to locate "Lists" tab
					lblCannotEditLists.Text = Localization.GetString ("UnableToFindLists", base.LocalResourceFile);
					lblCannotEditLists.Visible = true;
					lnkEditLists.Visible = false;
				}
			}
			else
			{
				//Show error, then hide the "Edit" link
				lblCannotEditLists.Text = Localization.GetString ("NoListAccess", base.LocalResourceFile);
				lblCannotEditLists.Visible = true;
				lnkEditLists.Visible = false;
			}
		}
Exemplo n.º 16
0
 public string GetAlarmRuleReportPageURL()
 {
     DotNetNuke.Entities.Tabs.TabController objTabCtrl = new DotNetNuke.Entities.Tabs.TabController();
     DotNetNuke.Entities.Tabs.TabInfo objTabInfo = null;
     objTabInfo = objTabCtrl.GetTabByName(AlarmRuleReportPageName, PortalId);
     if (objTabInfo != null)
         return objTabInfo.FullUrl;
     else return "";
 }
Exemplo n.º 17
0
 public string GetPageURL()
 {
     DotNetNuke.Entities.Tabs.TabController objTabCtrl = new DotNetNuke.Entities.Tabs.TabController();
     DotNetNuke.Entities.Tabs.TabInfo objTabInfo = null;
     objTabInfo = objTabCtrl.GetTabByName(PageName, PortalId);
     //objTabInfo.CultureCode = DotNetNuke.Entities.Tabs.TabController.CurrentPage.CultureCode;
     if (objTabInfo != null)
         return objTabInfo.FullUrl;
     else return "";
 }
Exemplo n.º 18
0
 protected void grvDanhSach_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         DataRow           r          = ((DataRowView)e.Row.DataItem).Row;
         HtmlInputCheckBox chkChon    = (HtmlInputCheckBox)(e.Row.FindControl("chkChon"));
         Label             lblStatus  = (Label)(e.Row.FindControl("lblStatus"));
         HyperLink         lnkIDCaSau = (HyperLink)(e.Row.FindControl("lnkIDCaSau"));
         Label             lblSTT     = (Label)(e.Row.FindControl("lblSTT"));
         DotNetNuke.Entities.Tabs.TabController tabCont = new DotNetNuke.Entities.Tabs.TabController();
         lnkIDCaSau.ToolTip = r["ID"].ToString();
         lnkIDCaSau.Attributes["onclick"] = "openwindow('" + DotNetNuke.Common.Globals.NavigateURL(tabCont.GetTabByName(ConfigurationManager.AppSettings["QLCS_CaSauListBienDongPage"], PortalId).TabID, "", "IDCaSau/" + r["IDCaSau"].ToString()) + "','',800,600);";
         lnkIDCaSau.Attributes["style"]   = "cursor:pointer;font-weight:bold;";
         chkChon.Attributes["name"]       = r["IDCaSau"].ToString();
         chkChon.Attributes["onclick"]    = "chon_click(event, this);";
         lblStatus.Text = r["TrangThai"].ToString();
         int t = e.Row.RowIndex + 1;
         lblSTT.Text = t.ToString();
     }
 }
 protected void btnEditBienDong_Click(object sender, EventArgs e)
 {
     CaSauBienDongPage = t.GetTabByName(ConfigurationManager.AppSettings["QLCS_CaSauBienDongPage"], PortalId).TabID;
     Session["EditBienDongCaSauGroupParam"] = ((Button)sender).CommandArgument;
     Page.ClientScript.RegisterStartupScript(typeof(string), "fail", "<script language=javascript>openwindow('" + DotNetNuke.Common.Globals.NavigateURL(CaSauBienDongPage, "", "type/" + ((Button)sender).CommandName) + "','',800,600);</script>", false);
 }
Exemplo n.º 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Page.ClientScript.RegisterClientScriptInclude("jquery", ResolveUrl("~/js/jquery.js"));
                if (!IsPostBack)
                {
                    txtTruocNgay.Text = DateTime.Now.AddDays(1).ToString("dd/MM/yyyy HH:mm:ss");
                    DataTable dtLoaiCa = csCont.LoadLoaiCa(1);
                    ddlLoaiCa.DataSource     = dtLoaiCa;
                    ddlLoaiCa.DataTextField  = "TenLoaiCa";
                    ddlLoaiCa.DataValueField = "IDLoaiCa";
                    ddlLoaiCa.DataBind();
                    ddlLoaiCa.Items.Insert(0, new ListItem("", "0"));

                    DataTable dtChuong = csCont.LoadChuong(1);
                    ddlChuong.DataSource     = dtChuong;
                    ddlChuong.DataTextField  = "Chuong";
                    ddlChuong.DataValueField = "IDChuong";
                    ddlChuong.DataBind();
                    ddlChuong.Items.Insert(0, new ListItem("", "0"));

                    DataTable dtCaMe = csCont.LoadCaSauMe_AllTrangThai();
                    ddlCaMe.DataSource     = dtCaMe;
                    ddlCaMe.DataTextField  = "CaMe";
                    ddlCaMe.DataValueField = "IDCaSau";
                    ddlCaMe.DataBind();
                    ddlCaMe.Items.Insert(0, new ListItem("", "0"));

                    DataTable dtStatus = new DataTable("Status");
                    DataRow   dr       = null;
                    dtStatus.Columns.AddRange(new DataColumn[] { new DataColumn("ID"), new DataColumn("Description") });
                    dr                = dtStatus.NewRow();
                    dr["ID"]          = 0;
                    dr["Description"] = "Bình thường";
                    dtStatus.Rows.Add(dr);
                    dr                = dtStatus.NewRow();
                    dr["ID"]          = 1;
                    dr["Description"] = "Bệnh";
                    dtStatus.Rows.Add(dr);
                    dr                = dtStatus.NewRow();
                    dr["ID"]          = -4;
                    dr["Description"] = "Loại thải";
                    dtStatus.Rows.Add(dr);
                    dr                = dtStatus.NewRow();
                    dr["ID"]          = -3;
                    dr["Description"] = "Đã bán";
                    dtStatus.Rows.Add(dr);
                    dr                = dtStatus.NewRow();
                    dr["ID"]          = -2;
                    dr["Description"] = "Giết mổ";
                    dtStatus.Rows.Add(dr);
                    dr                = dtStatus.NewRow();
                    dr["ID"]          = -1;
                    dr["Description"] = "Chết";
                    dtStatus.Rows.Add(dr);
                    ddlStatus.DataSource     = dtStatus;
                    ddlStatus.DataValueField = "ID";
                    ddlStatus.DataTextField  = "Description";
                    ddlStatus.DataBind();

                    DotNetNuke.Entities.Tabs.TabController t = new DotNetNuke.Entities.Tabs.TabController();
                    int CaSauBienDongPage = t.GetTabByName(ConfigurationManager.AppSettings["QLCS_CaSauBienDongPage"], PortalId).TabID;

                    btnChuyenChuong.Attributes["onclick"]          = "openwindow('" + DotNetNuke.Common.Globals.NavigateURL(CaSauBienDongPage, "", "type/chuyenchuong") + "','',600,400);";
                    btnChuyenGioiTinh.Attributes["onclick"]        = "openwindow('" + DotNetNuke.Common.Globals.NavigateURL(CaSauBienDongPage, "", "type/chuyengioitinh") + "','',600,400);";
                    btnChuyenLoaiCa.Attributes["onclick"]          = "openwindow('" + DotNetNuke.Common.Globals.NavigateURL(CaSauBienDongPage, "", "type/chuyenloaica") + "','',600,400);";
                    btnChuyenNguonGoc.Attributes["onclick"]        = "openwindow('" + DotNetNuke.Common.Globals.NavigateURL(CaSauBienDongPage, "", "type/chuyennguongoc") + "','',600,400);";
                    btnChuyenMaSo.Attributes["onclick"]            = "openwindow('" + DotNetNuke.Common.Globals.NavigateURL(CaSauBienDongPage, "", "type/chuyenmaso") + "','',600,400);";
                    btnChuyenTrangThai.Attributes["onclick"]       = "openwindow('" + DotNetNuke.Common.Globals.NavigateURL(CaSauBienDongPage, "", "type/chuyentrangthai") + "','',1200,600);";
                    btnChuyenGiong.Attributes["onclick"]           = "openwindow('" + DotNetNuke.Common.Globals.NavigateURL(CaSauBienDongPage, "", "type/chuyengiong") + "','',600,400);";
                    btnChuyenNgayNo.Attributes["onclick"]          = "openwindow('" + DotNetNuke.Common.Globals.NavigateURL(CaSauBienDongPage, "", "type/chuyenngayno") + "','',600,400);";
                    btnChuyenNgayXuongChuong.Attributes["onclick"] = "openwindow('" + DotNetNuke.Common.Globals.NavigateURL(CaSauBienDongPage, "", "type/chuyenngayxuongchuong") + "','',600,400);";
                    btnChuyenCaMe.Attributes["onclick"]            = "openwindow('" + DotNetNuke.Common.Globals.NavigateURL(CaSauBienDongPage, "", "type/chuyencame") + "','',600,400);";

                    lnkAddCaSau.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "casau_add", "mid/" + this.ModuleId.ToString());

                    if (Session["AutoDisplay_CS"] != null && Convert.ToBoolean(Session["AutoDisplay_CS"]))
                    {
                        txtID.Text   = Session["CSAdmin_ID"].ToString();
                        txtMaSo.Text = Session["CSAdmin_MaSo"].ToString();
                        ddlGioiTinh.SelectedValue = Session["CSAdmin_GioiTinh"].ToString();
                        Config.SetSelectedValues(ddlLoaiCa, Session["CSAdmin_LoaiCa"].ToString());
                        Config.SetSelectedValues(ddlChuong, Session["CSAdmin_Chuong"].ToString());
                        Config.SetSelectedValues(ddlCaMe, Session["CSAdmin_CaMe"].ToString());
                        if (Session["CSAdmin_TrangThai"] != null && Session["CSAdmin_TrangThai"].ToString() != "")
                        {
                            Config.SetSelectedValues(ddlStatus, Session["CSAdmin_TrangThai"].ToString());
                        }
                        else
                        {
                            Config.SetSelectedValues(ddlStatus, "0, 1, ");
                        }
                        btnLoad_Click(null, null);
                    }
                    else
                    {
                        Config.SetSelectedValues(ddlStatus, "0, 1, ");
                    }

                    if (!UserInfo.IsSuperUser && !UserInfo.IsInRole("Administrators") && !CaSauController.HasEditPermission(UserInfo.Roles, "QLCS"))
                    {
                        lnkAddCaSau.Visible             = false;
                        tdSub.Visible                   = false;
                        grvDanhSach.Columns[12].Visible = false;
                    }
                    hdListBienDongPage.Value = t.GetTabByName(ConfigurationManager.AppSettings["QLCS_CaSauListBienDongPage"], PortalId).TabID.ToString();
                }
            }
            catch (Exception ex)
            {
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Page.ClientScript.RegisterClientScriptInclude("jquery", ResolveUrl("~/js/jquery.js"));
                DataTable tblVatTu = csCont.VatTu_GetByString(sVatTuGietMo);
                foreach (DataRow r in tblVatTu.Rows)
                {
                    Label lblIDVatTu = new Label();
                    lblIDVatTu.ID   = "lblIDVatTu" + r["IDVatTu"].ToString();
                    lblIDVatTu.Text = "<div style='width:200px;float:left;text-align:left;'>" + r["TenVatTu"].ToString() + "</div>";
                    dsVatTu.Controls.Add(lblIDVatTu);
                    TextBox txt = new TextBox();
                    txt.ID = r["IDVatTu"].ToString();
                    txt.Attributes["style"] = "float:left;text-align:right;width:70px;";
                    txt.Text = "0";
                    dsVatTu.Controls.Add(txt);

                    Label lblDVT = new Label();
                    lblDVT.Text = "<div style='text-align:left;float:left;width:40px;'>&nbsp;" + r["DonViTinh"].ToString() + "</div>";
                    lblDVT.ID   = "lblDVT" + r["IDVatTu"].ToString();
                    dsVatTu.Controls.Add(lblDVT);

                    Label lblXuongDong = new Label();
                    lblXuongDong.Text = "<div style='clear:both;'></div>";
                    dsVatTu.Controls.Add(lblXuongDong);
                }
                if (!IsPostBack)
                {
                    if (Request.QueryString["gietmoca"] != null)
                    {
                        lblGMC.Text = Request.QueryString["gietmoca"];
                    }
                    DataTable dtLoaiCa = csCont.LoadLoaiCa(1);
                    ddlLoaiCa.DataSource     = dtLoaiCa;
                    ddlLoaiCa.DataTextField  = "TenLoaiCa";
                    ddlLoaiCa.DataValueField = "IDLoaiCa";
                    ddlLoaiCa.DataBind();
                    ddlLoaiCa.Items.Insert(0, new ListItem("-----", "0"));

                    DataTable dtChuong = csCont.LoadChuong(1);
                    ddlChuong.DataSource     = dtChuong;
                    ddlChuong.DataTextField  = "Chuong";
                    ddlChuong.DataValueField = "IDChuong";
                    ddlChuong.DataBind();
                    ddlChuong.Items.Insert(0, new ListItem("-----", "0"));

                    DataTable dtCaMe = csCont.LoadCaSauMe_AllTrangThai();
                    ddlCaMe.DataSource     = dtCaMe;
                    ddlCaMe.DataTextField  = "CaMe";
                    ddlCaMe.DataValueField = "IDCaSau";
                    ddlCaMe.DataBind();
                    ddlCaMe.Items.Insert(0, new ListItem("-----", "0"));

                    DataTable dtNguoiMo = csCont.LoadNhanVien(1);
                    ddlNguoiMo.DataSource     = dtNguoiMo;
                    ddlNguoiMo.DataTextField  = "TenNhanVien";
                    ddlNguoiMo.DataValueField = "IDNhanVien";
                    ddlNguoiMo.DataBind();

                    //Xem xet co cho phep save va delete hay khong
                    DataTable tblGMC = csCont.GietMoCa_GetByID(int.Parse(lblGMC.Text));
                    if (Convert.ToDateTime(tblGMC.Rows[0]["NgayMo"]) < Config.NgayKhoaSo())
                    {
                        allowEdit = false;
                    }
                    else
                    {
                        if (!UserInfo.IsSuperUser && !UserInfo.IsInRole("Administrators") && !CaSauController.HasEditPermission(UserInfo.Roles, "QLCS"))
                        {
                            allowEdit = false;
                        }
                        else
                        {
                            if (Convert.ToBoolean(tblGMC.Rows[0]["Lock"]))
                            {
                                allowEdit = false;
                            }
                            else
                            {
                                allowEdit = true;
                            }
                        }
                    }

                    if (Request.QueryString["gmcct"] != null)
                    {
                        SearchCa.Visible  = false;
                        btnDelete.Visible = true;
                        lblGMCCT.Text     = Request.QueryString["gmcct"];
                        DataTable dtGMCCT = csCont.GietMoCa_GetChiTietByChiTietID(int.Parse(lblGMCCT.Text), 1);
                        if (dtGMCCT.Rows.Count == 1)
                        {
                            DataRow r = dtGMCCT.Rows[0];
                            //lblGMC.Text = r["GietMoCa"].ToString();
                            txtIDCa.Text                  = r["Ca"].ToString();
                            txtDa_TrongLuong.Text         = ((decimal)r["Da_TrongLuong"]).ToString("0.#####");
                            txtDa_Bung.Text               = r["Da_Bung"].ToString();
                            ddlDa_PhanLoai.SelectedValue  = r["Da_PhanLoai"].ToString();
                            chkDau.Checked                = Convert.ToBoolean(r["Dau"]);
                            txtTrongLuongHoi.Text         = ((decimal)r["TrongLuongHoi"]).ToString("0.#####");
                            txtTrongLuongMocHam.Text      = ((decimal)r["TrongLuongMocHam"]).ToString("0.#####");
                            ddlPhuongPhapMo.SelectedValue = r["PhuongPhapMo"].ToString();
                            ddlNguoiMo.SelectedValue      = r["NguoiMo"].ToString();
                            LoadStringVatTuToControls(r["VatTu"].ToString(), dsVatTu);
                            if (Convert.ToInt32(r["Status"]) == -4)
                            {
                                chkDiTat.Checked = true;
                            }

                            if (allowEdit)
                            {
                                btnSave.Visible   = true;
                                btnDelete.Visible = true;
                            }
                            else
                            {
                                btnSave.Visible   = false;
                                btnDelete.Visible = false;
                            }
                        }
                        else
                        {
                            btnSave.Visible   = false;
                            btnDelete.Visible = false;
                        }
                    }
                    else
                    {
                        btnDelete.Visible = false;
                        if (allowEdit)
                        {
                            btnSave.Visible = true;
                        }
                        else
                        {
                            btnSave.Visible = false;
                        }
                    }
                }
                hdListBienDongPage.Value = t.GetTabByName(ConfigurationManager.AppSettings["QLCS_CaSauListBienDongPage"], PortalId).TabID.ToString();
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
Exemplo n.º 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                tblVatTu = csCont.VatTu_GetByString(sVatTuGietMo);
                if (!IsPostBack)
                {
                    DataTable dtLoaiCa = csCont.LoadLoaiCa(1);
                    ddlLoaiCa.DataSource     = dtLoaiCa;
                    ddlLoaiCa.DataTextField  = "TenLoaiCa";
                    ddlLoaiCa.DataValueField = "IDLoaiCa";
                    ddlLoaiCa.DataBind();
                    ddlLoaiCa.Items.Insert(0, new ListItem("", "0"));

                    DataTable dtChuong = csCont.LoadChuong(1);
                    ddlChuong.DataSource     = dtChuong;
                    ddlChuong.DataTextField  = "Chuong";
                    ddlChuong.DataValueField = "IDChuong";
                    ddlChuong.DataBind();
                    ddlChuong.Items.Insert(0, new ListItem("", "0"));

                    DataTable dtCaMe = csCont.LoadCaSauMe_AllTrangThai();
                    ddlCaMe.DataSource     = dtCaMe;
                    ddlCaMe.DataTextField  = "CaMe";
                    ddlCaMe.DataValueField = "IDCaSau";
                    ddlCaMe.DataBind();
                    ddlCaMe.Items.Insert(0, new ListItem("", "0"));

                    DataTable dtBienBan = csCont.GetBienBanCaChet();
                    lstBienBan.DataSource     = dtBienBan;
                    lstBienBan.DataTextField  = "BienBan";
                    lstBienBan.DataValueField = "BienBan";
                    lstBienBan.DataBind();
                    lstBienBan.Items.Insert(0, new ListItem("", "0"));

                    if (Session["AutoDisplay_CSChet"] != null && Convert.ToBoolean(Session["AutoDisplay_CSChet"]))
                    {
                        txtID.Text   = Session["CSChet_ID"].ToString();
                        txtMaSo.Text = Session["CSChet_MaSo"].ToString();
                        ddlGioiTinh.SelectedValue = Session["CSChet_GioiTinh"].ToString();
                        Config.SetSelectedValues(ddlLoaiCa, Session["CSChet_LoaiCa"].ToString());
                        Config.SetSelectedValues(ddlChuong, Session["CSChet_Chuong"].ToString());
                        Config.SetSelectedValues(ddlCaMe, Session["CSChet_CaMe"].ToString());
                        Config.SetSelectedValues(lstBienBan, Session["CSChet_BienBan"].ToString());
                        btnLoad_Click(null, null);
                    }

                    if (!UserInfo.IsSuperUser && !UserInfo.IsInRole("Administrators") && !CaSauController.HasEditPermission(UserInfo.Roles, "KhoaCS"))
                    {
                        btnKhoa.Visible   = false;
                        btnMoKhoa.Visible = false;
                        grvDanhSach.Columns[0].Visible = false;
                    }

                    if (!UserInfo.IsSuperUser && !UserInfo.IsInRole("Administrators") && !CaSauController.HasEditPermission(UserInfo.Roles, "QLCS"))
                    {
                        hdCanEdit.Value = "0";
                        grvDanhSach.Columns[20].Visible = false;
                        grvDanhSach.Columns[22].Visible = false;
                        grvDanhSach.Columns[23].Visible = false;
                    }
                    else
                    {
                        hdCanEdit.Value = "1";
                    }
                    DotNetNuke.Entities.Tabs.TabController t = new DotNetNuke.Entities.Tabs.TabController();
                    hdListBienDongPage.Value = t.GetTabByName(ConfigurationManager.AppSettings["QLCS_CaSauListBienDongPage"], PortalId).TabID.ToString();
                }
                else
                {
                    foreach (GridViewRow r in grvDanhSach.Rows)
                    {
                        PlaceHolder dsVatTu = (PlaceHolder)(r.FindControl("dsVatTu"));
                        foreach (DataRow rr in tblVatTu.Rows)
                        {
                            Label lblIDVatTu = new Label();
                            lblIDVatTu.ID   = "lblIDVatTu" + rr["IDVatTu"].ToString();
                            lblIDVatTu.Text = "<div style='float:left;text-align:left;'>" + rr["TenVatTu"].ToString() + "</div>";
                            dsVatTu.Controls.Add(lblIDVatTu);
                            TextBox txt = new TextBox();
                            txt.ID = rr["IDVatTu"].ToString();
                            txt.Attributes["style"] = "float:left;text-align:right;width:30px;margin-left:3px;";
                            txt.Text = "0";
                            dsVatTu.Controls.Add(txt);

                            Label lblXuongDong = new Label();
                            lblXuongDong.Text = "<br/";
                            dsVatTu.Controls.Add(lblXuongDong);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
 protected void btnSaveCaSauAn_Click(object sender, EventArgs e)
 {
     try
     {
         System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.CreateSpecificCulture("vi-VN");
         if (txtThoiDiem.Text == "")
         {
             Page.ClientScript.RegisterStartupScript(typeof(string), "ngaychoanrong", "alert('Bạn phải nhập ngày cho ăn!');", true);
             return;
         }
         else if (!txtThoiDiem.Text.Contains(" 23:00:00"))
         {
             Page.ClientScript.RegisterStartupScript(typeof(string), "ngaychoansai", "alert('Giờ cho ăn phải là 23:00:00!');", true);
             return;
         }
         DateTime dtNgayChoAn = DateTime.Parse(txtThoiDiem.Text, ci);
         if (dtNgayChoAn < Config.NgayKhoaSo())
         {
             Page.ClientScript.RegisterStartupScript(typeof(string), "insertupdatefail", "alert('Ngày cho ăn không được trước ngày khóa sổ');", true);
             return;
         }
         if (hdCaSauAn.Value != "")
         {
             int res = csCont.CaSauAn_Update(int.Parse(hdCaSauAn.Value), dtNgayChoAn, UserId);
             if (res == 0)
             {
                 Page.ClientScript.RegisterStartupScript(typeof(string), "ngaykhonghople", "alert('Ngày cho ăn không hợp lệ!');", true);
             }
             else
             {
                 UpdateThucAn(int.Parse(hdCaSauAn.Value));
                 UpdateThuoc(int.Parse(hdCaSauAn.Value));
                 LoadThuoc();
                 Page.ClientScript.RegisterStartupScript(typeof(string), "ngayhople", "alert('Đã cập nhật ngày cho ăn!');", true);
             }
         }
         else
         {
             int res = csCont.CaSauAn_ThemMoi(dtNgayChoAn, UserId, "");
             if (res != 0)
             {
                 hdCaSauAn.Value        = res.ToString();
                 tblThuocChuong.Visible = true;
                 lnkThucAn.NavigateUrl  = DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "casauan_edit_thucan", "csaid/" + hdCaSauAn.Value, "mid/" + this.ModuleId.ToString());
                 DotNetNuke.Entities.Tabs.TabController t = new DotNetNuke.Entities.Tabs.TabController();
                 int ThuocMultiPage = t.GetTabByName(ConfigurationManager.AppSettings["QLCS_CaSauAnThuocMulti"], PortalId).TabID;
                 lnkThuocMulti.Attributes["onclick"] = "openwindow('" + DotNetNuke.Common.Globals.NavigateURL(ThuocMultiPage, "", "csaid/" + hdCaSauAn.Value) + "','CaSauAn',900,600);";
                 //lnkThuocMulti.Attributes["onclick"] = "openwindow('" + DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "casauan_thuoc_multi", "csaid/" + hdCaSauAn.Value, "mid/" + this.ModuleId.ToString()) + "','CaSauAn',900,600);";
                 BindThuocControls(dtNgayChoAn);
                 ddlThuoc_SelectedIndexChanged(null, null);
                 if (ddlLoaiCa.SelectedValue == "1")
                 {
                     scaleCT = scaleCT + 2;
                 }
                 Page.ClientScript.RegisterStartupScript(typeof(string), "initthapphan", "$('#txtThapPhan').val('" + scaleCT.ToString() + "');", true);
             }
             else
             {
                 Page.ClientScript.RegisterStartupScript(typeof(string), "ngaykhonghople", "alert('Ngày cho ăn không hợp lệ!');", true);
                 return;
             }
         }
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
 }
Exemplo n.º 24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                NewsController cont  = new NewsController();
                int            tabid = 0;
                DotNetNuke.Entities.Tabs.TabController tabCont = new DotNetNuke.Entities.Tabs.TabController();
                DotNetNuke.Entities.Tabs.TabInfo       tab     = tabCont.GetTabByName(ConfigurationManager.AppSettings["ThuVienSo_ListNewsPage"], PortalId);
                if (tab != null)
                {
                    tabid = tab.TabID;
                }

                //lnk1.Attributes["onclick"] = "window.location.href='" + DotNetNuke.Common.Globals.NavigateURL(tabid, "", "categoryid/0_TieuDiem") + "';return false;";
                //lnk2.Attributes["onclick"] = "window.location.href='" + DotNetNuke.Common.Globals.NavigateURL(tabid, "", "categoryid/0_MoiBanHanh") + "';return false;";
                //lnk3.Attributes["onclick"] = "window.location.href='" + DotNetNuke.Common.Globals.NavigateURL(tabid, "", "categoryid/0_BanChuaBiet") + "';return false;";

                ltTieuDe1.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(tabid, "", "categoryid/0_TieuDiem");
                ltTieuDe2.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(tabid, "", "categoryid/0_MoiBanHanh");
                ltTieuDe3.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(tabid, "", "categoryid/0_BanChuaBiet");

                if (Settings["tieude1"] != null)
                {
                    ltTieuDe1.Text = Settings["tieude1"].ToString(); ltTieuDe1.Attributes["class"] = "TieuDe1";
                }
                if (Settings["tieude2"] != null)
                {
                    ltTieuDe2.Text = Settings["tieude2"].ToString(); ltTieuDe2.Attributes["class"] = "TieuDe2";
                }
                if (Settings["tieude3"] != null)
                {
                    ltTieuDe3.Text = Settings["tieude3"].ToString(); ltTieuDe3.Attributes["class"] = "TieuDe3";
                }

                if (Settings["baiviet1"] != null && Settings["baiviet1"].ToString() != "")
                {
                    string      baiviet1 = Settings["baiviet1"].ToString();
                    XmlDocument doc1     = LoadData(baiviet1, "1");
                    XmlElement  root1    = doc1.DocumentElement;
                    if (doc1.InnerXml != "<newslist></newslist>")
                    {
                        if (Settings["template1"] != null)
                        {
                            string template1 = PortalSettings.HomeDirectory + "Xsl/" + Settings["template1"].ToString();
                            DotNetNuke.NewsProvider.Utils.XMLTransform(lt1, template1, doc1);
                        }
                    }
                }

                if (Settings["baiviet2"] != null && Settings["baiviet2"].ToString() != "")
                {
                    string      baiviet2 = Settings["baiviet2"].ToString();
                    XmlDocument doc2     = LoadData(baiviet2, "2");
                    XmlElement  root2    = doc2.DocumentElement;
                    if (doc2.InnerXml != "<newslist></newslist>")
                    {
                        if (Settings["template2"] != null)
                        {
                            string template2 = PortalSettings.HomeDirectory + "Xsl/" + Settings["template2"].ToString();
                            DotNetNuke.NewsProvider.Utils.XMLTransform(lt2, template2, doc2);
                        }
                    }
                }

                if (Settings["baiviet3"] != null && Settings["baiviet3"].ToString() != "")
                {
                    string      baiviet3 = Settings["baiviet3"].ToString();
                    XmlDocument doc3     = LoadData(baiviet3, "3");
                    XmlElement  root3    = doc3.DocumentElement;
                    if (doc3.InnerXml != "<newslist></newslist>")
                    {
                        if (Settings["template3"] != null)
                        {
                            string template3 = PortalSettings.HomeDirectory + "Xsl/" + Settings["template3"].ToString();
                            DotNetNuke.NewsProvider.Utils.XMLTransform(lt3, template3, doc3);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (System.Threading.Thread.CurrentThread.CurrentCulture.ToString() == "vi-VN")
                {
                    thapphan = ",";
                }
                else
                {
                    thapphan = ".";
                }
                scale   = int.Parse(ConfigurationManager.AppSettings["QLCS_VatTu_TTY_Scale"]);
                scaleCT = scale;
                Page.ClientScript.RegisterClientScriptInclude("jquery", ResolveUrl("~/js/impromptu/jquery.js"));
                if (!Page.IsPostBack)
                {
                    lnkCancel.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mid/" + this.ModuleId.ToString());
                    if (Request.QueryString["csaid"] != null)
                    {
                        hdCaSauAn.Value = Request.QueryString["csaid"];
                    }
                    if (hdCaSauAn.Value == "")
                    {
                        tblThuocChuong.Visible = false;
                        BindCaSauAnControls();
                    }
                    else
                    {
                        tblThuocChuong.Visible = true;
                        BindCaSauAnControls();
                        LoadCaSauAn(int.Parse(hdCaSauAn.Value));
                        BindThuocControls_Edit();
                        LoadThuoc();
                    }
                }

                if (!UserInfo.IsSuperUser && !UserInfo.IsInRole("Administrators") && !CaSauController.HasEditPermission(UserInfo.Roles, "QLCS"))
                {
                    btnSaveCaSauAn.Visible = false;
                    btnSaveThuoc.Visible   = false;
                    pnlCommand.Visible     = false;
                    lnkThuocMulti.Visible  = false;
                }
                else
                {
                    if (ddlRowStatus.SelectedValue == "0")
                    {
                        pnlCommand.Visible = false;
                    }
                    else
                    {
                        pnlCommand.Visible = true;
                    }
                }

                if (hdCaSauAn.Value != "")
                {
                    lnkThucAn.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "casauan_edit_thucan", "csaid/" + hdCaSauAn.Value, "mid/" + this.ModuleId.ToString());
                    DotNetNuke.Entities.Tabs.TabController t = new DotNetNuke.Entities.Tabs.TabController();
                    int ThuocMultiPage = t.GetTabByName(ConfigurationManager.AppSettings["QLCS_CaSauAnThuocMulti"], PortalId).TabID;
                    lnkThuocMulti.Attributes["onclick"] = "openwindow('" + DotNetNuke.Common.Globals.NavigateURL(ThuocMultiPage, "", "csaid/" + hdCaSauAn.Value) + "','CaSauAn',900,600);";
                    //lnkThuocMulti.Attributes["onclick"] = "openwindow('" + DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "casauan_thuoc_multi", "csaid/" + hdCaSauAn.Value, "mid/" + this.ModuleId.ToString()) + "','CaSauAn',900,600);";
                }
                if (ddlLoaiCa.SelectedValue == "1")
                {
                    scaleCT = scaleCT + 2;
                }
                lnkPhanBoThuoc.Attributes["onclick"] = "phanbothuoc();";
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
                btnSaveCaSauAn.Visible = false;
                btnSaveThuoc.Visible   = false;
            }
        }
Exemplo n.º 26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Register Jquery Usage
            jQuery.RequestRegistration();
            jQuery.RequestUIRegistration();
            jQuery.RequestDnnPluginsRegistration();

            if (currentUser.IsSuperUser || currentUser.IsInRole("clubadmin"))
            {
                m_ModuelControl = "frmClub.ascx";
            }
            else
            {
                m_ModuelControl = "frmSeason.ascx";

                li_HomeLink.Visible              = false;
                li_SportsRegistration.Visible    = false;
                li_SeasonLink.Visible            = false;
                li_ClubeRegistrationLink.Visible = false;
                li_Masters.Visible          = false;
                li_ClubMemberType.Visible   = false;
                li_UserType.Visible         = false;
                li_Registration.Visible     = false;
                li_AddDocumentsType.Visible = false;
                li_Event.Visible            = false;
                li_SponsorType.Visible      = false;
                li_SponsorLevel.Visible     = false;
                li_PlayerType.Visible       = false;
                li_TeamMemberType.Visible   = false;
                li_Sponsor.Visible          = false;
                li_Media.Visible            = false;
                li_News.Visible             = false;
                li_Pictures.Visible         = false;
                li_Videos.Visible           = false;
                li_MatchType.Visible        = false;
                li_MerchandiseType.Visible  = false;
                //li_MerchandiseTYpe.Visible = false;
                li_Album.Visible = false;

                //li_UserRole.Visible = false;

                //li_TournamentLink.Visible = false;

                //li_SponsorRegLink.Visible = false;
                //li_TeamProfile.Visible = false;
                //li_UserRegLink.Visible = false;
                //li_LocationLink.Visible = false;
                //li_NewsLink.Visible = false;
                //li_NationalTeamLink.Visible = false;

                //li_NationalTeamListLink.Visible = false;
                //li_NationalTeamPlayerAssignInGameLink.Visible = false;

                //li_PollLink.Visible = false;
                //li_SuspensionLink.Visible = false;
                //li_AssignAwards.Visible = false;
                //li_AssignAwardsPosition.Visible = false;
                //li_AwardsList.Visible = false;
                //li_AssignWinner.Visible = false;
                //li_AssignWinnerPosition.Visible = false;
                //li_WinnerList.Visible = false;

                //li_Reports.Visible = false;
                //li_ReportTopScorer.Visible = false;
            }

            try
            {
                LoadModuleControl();
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }

            if (!Page.IsPostBack)
            {
                //Get Home Page TabId
                tInfo1 = tabs1.GetTabByName("Home", PortalId);

                HomeLink.NavigateUrl           = Globals.NavigateURL(tInfo1.TabID, "");
                hlSports.NavigateUrl           = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmSports");
                hlSeason.NavigateUrl           = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmSeason");
                hlClub.NavigateUrl             = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmClub");
                hlClubMemberType.NavigateUrl   = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmClubMemberType");
                hlUserType.NavigateUrl         = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmUserType");
                hlRegistration.NavigateUrl     = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmRegistration");
                hlAddDocumentsType.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmAddDocumentsType");
                hlEvent.NavigateUrl            = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmEvent");
                hlSponsorType.NavigateUrl      = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmSponsorType");
                hlSponsorLevel.NavigateUrl     = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmSponsorLevel");
                hlPlayerType.NavigateUrl       = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmPlayerType");
                hlTeamMemberType.NavigateUrl   = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmTeamMemberType");
                hlSponsor.NavigateUrl          = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmSponsor");
                hlNews.NavigateUrl             = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmNews");
                hlPictures.NavigateUrl         = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmPictures");
                hlVideos.NavigateUrl           = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmVideos");
                //hlUserRole.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmUserRole");
                hlAlbum.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmAlbum");
                hlAssignPlayerInTeam.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmAssignPlayerInTeam");

                hlCompetitionType.NavigateUrl   = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmCompetitionType");
                hlCompetitionLeague.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmCompetitionLeague");
                hlCompetitionFormat.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmCompetitionFormat");
                hlCompetition.NavigateUrl       = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmCompetition");
                hlDivision.NavigateUrl          = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmDivision");

                hlTeam.NavigateUrl            = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmTeam");
                hlLocation.NavigateUrl        = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmLocation");
                hlMatchStatus.NavigateUrl     = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmMatchStatus");
                hlMatchType.NavigateUrl       = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmMatchType");
                hlMerchandiseType.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmMerchandiseType");
                hlMerchandise.NavigateUrl     = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmMerchandise");
            }
        }