예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["cnKey"] != null)
         cnKey = Session["cnKey"].ToString();
     ID = Request.QueryString["ID"] + "";
     FormID = Request.QueryString["FormID"] + "";
     if (!IsPostBack)
     {
         ViewState["StrWhere"] = string.Format(" DepartmentID='{0}' and EnterpriseID='{1}'", ID, Session["EnterpriseID"].ToString());
         Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey);
         if (ID != "")
         {
             DataTable dt = dal.GetRecord(ViewState["StrWhere"].ToString());
             BindData(dt);
             this.txtDepartmentID.ReadOnly = true;
         }
         else
         {
             this.txtDepartmentID.Text = dal.GetMaxID("EnterpriseID='" + Session["EnterpriseID"].ToString() + "'");
             this.txtEnterpriseID.Text = Session["EnterpriseID"].ToString();
             this.txtEnterpriseName.Text = Session["EnterpriseName"].ToString();
             this.txtLastModifyUserName.Text = Session["User"].ToString();
             this.txtLastModifyDate.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm");
             this.txtCreateUserName.Text = Session["User"].ToString();
             this.txtCreateDate.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm");
         }
     }
 }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        BillID = Request.QueryString["BillID"] + "";
        FormID = Request.QueryString["FormID"] + "";
        if (!IsPostBack)
        {
            ViewState["StrWhere"] = string.Format(" BillID='{0}'", BillID);
            Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey);
            if (BillID != "")
            {
                DataTable dt = dal.GetRecord(ViewState["StrWhere"].ToString());
                BindData(dt);
                this.txtBillID.ReadOnly = true;
            }
            else
            {
                this.txtBillID.Text = dal.GetMaxID();
                this.txtLastModifyUserName.Text = Session["User"].ToString();
                this.txtLastModifyDate.Text = DateTime.Now.ToString(Js.Com.User.strDateFormat);
                this.txtCreateUserName.Text = Session["User"].ToString();
                this.txtCreateDate.Text = DateTime.Now.ToString(Js.Com.User.strDateFormat);
            }

        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        ID = Request.QueryString["ID"] + "";
        FormID = Request.QueryString["FormID"] + "";
        if (!IsPostBack)
        {

            ViewState["StrWhere"] = string.Format(" ProductionUnitID='{0}'", ID);
            Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey);
            if (ID != "")
            {
                DataTable dt = dal.GetRecord(ViewState["StrWhere"].ToString());
                BindData(dt);
                this.txtProductionUnitID.ReadOnly = true;
            }
            else
            {
                this.txtProductionUnitID.Text = dal.GetMaxID();
                this.txtLastModifyUserName.Text = Session["User"].ToString();
                this.txtLastModifyDate.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm");
                this.txtCreateUserName.Text = Session["User"].ToString();
                this.txtCreateDate.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm");
            }
            //BindEdll();
        }
    }
예제 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ID = Request.QueryString["ID"] + "";
        FormID = Request.QueryString["FormID"] + "";
        if (!IsPostBack)
        {
            ViewState["StrWhere"] = string.Format(" StateID='{0}'", ID);
            Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey);
            if (ID != "")
            {
                DataTable dt = dal.GetRecord(ViewState["StrWhere"].ToString());
                BindData(dt);
                this.txtStateListID.ReadOnly = true;
                this.txtStateListID.CssClass = "TextRead";
            }
            else
            {
                this.txtStateListID.Text = dal.GetMaxID();
                this.ddlStyle.SelectedIndex = 1;
                this.txtLastModifyUserName.Text = Session["User"].ToString();
                this.txtLastModifyDate.Text =ToYMDHM( DateTime.Now);
                this.txtCreateUserName.Text = Session["User"].ToString();
                this.txtCreateDate.Text =ToYMDHM( DateTime.Now);
            }
            BindEdll();

            txtStateListID.MaxLength = 2;//代碼
            txtStateName.MaxLength = 8;//企業用戶名稱
            txtMemo.MaxLength = 300;//狀態說明

            if (this.ddlStyle.SelectedIndex == 0)
            {
                txtStateListID.ReadOnly = true;
                txtStateListID.CssClass = "TextRead";
                txtStateName.ReadOnly = true;
                txtStateName.CssClass = "TextRead";
                ddlStyle.Enabled = false;
                chkImageProvider.Enabled = false;
            }
        }
    }
예제 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ID = Request.QueryString["ID"] + "";
        FormID = Request.QueryString["FormID"] + "";
        if (!IsPostBack)
        {
            BindEdll();
            ViewState["StrWhere"] = string.Format(" MemberID='{0}'", ID);
            Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey);
            if (ID != "")
            {
                DataTable dt = dal.GetRecord(ViewState["StrWhere"].ToString());
                BindData(dt);
                this.txtMemberID.ReadOnly = true;
            }
            else
            {
                this.txtMemberID.Text = dal.GetMaxID();
            }

        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        ID = Request.QueryString["ID"] + "";
        FormID = Request.QueryString["FormID"] + "";
        if (!IsPostBack)
        {
            ViewState["StrWhere"] = string.Format(" AnnounceID='{0}'", ID);
            if (Session["UserType"].ToString() == "BU")
            {
                this.txtAnnounceFlag.Text = Resources.Resource.AnnounceFlag1;
                Js.BLL.BusinessUnit.CompanyDal cdal = new Js.BLL.BusinessUnit.CompanyDal();
                Js.Model.BusinessUnit.CompanyInfo model = cdal.GetModel();
                this.txtAnnounceUnitNo.Text = model.CompanyNo;
                Js.BLL.Account.UserDal udal = new Js.BLL.Account.UserDal();
                Js.Model.Account.UsersInfo umodel = udal.GetModel(Session["User"].ToString());
                this.txtAnnouncer.Text = umodel.PersonName;
            }
            else
            {
                this.txtAnnounceFlag.Text = Resources.Resource.AnnounceFlag2;
                this.txtAnnounceUnitNo.Text = Session["EnterpriseID"].ToString();

                Js.BLL.Account.UserDal udal = new Js.BLL.Account.UserDal(Session["EnterpriseID"].ToString());
                Js.Model.Account.UsersInfo umodel = udal.GetModel(Session["User"].ToString());
                this.txtAnnouncer.Text = umodel.PersonName;
            }

            Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID);
            string strWhere = " AnnounceID like '" + this.txtAnnounceUnitNo.Text + DateTime.Now.ToString("yyyyMMdd") + "%'";
            dal.GetMaxID(strWhere);

            this.txtAnnounceID.Text = dal.GetMaxID(strWhere);
            if(this.txtAnnounceID.Text.Length<=0)
                this.txtAnnounceID.Text =this.txtAnnounceUnitNo.Text + DateTime.Now.ToString("yyyyMMdd") + "0001";
            this.txtAnnouncerUserName.Text = Session["User"].ToString();
            this.txtSource.Text = Resources.Resource.AnnounceSource1;

            BindGrid();
        }
    }
예제 #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ID = Request.QueryString["ID"] + "";
        FormID = Request.QueryString["FormID"] + "";
        if (!IsPostBack)
        {
            BindDropDownList();
            ViewState["StrWhere"] = string.Format(" StyleID='{0}'", ID);
            Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID,cnKey);
            if (ID != "")
            {
                DataTable dt = dal.GetRecord(ViewState["StrWhere"].ToString());
                BindData(dt);
                this.txtStyleID.ReadOnly = true;
            }
            else
            {
                this.txtStyleID.Text = dal.GetMaxID();
                this.txtLastModifyUserName.Text = Session["User"].ToString();
                this.txtLastModifyDate.Text = ToYMDHM(DateTime.Now);
                this.txtCreateUserName.Text = Session["User"].ToString();
                this.txtCreateDate.Text = ToYMDHM(DateTime.Now);
            }

            BindOther();
        }
    }
예제 #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ID = Request.QueryString["ID"] + "";
     FormID = Request.QueryString["FormID"] + "";
     if (!IsPostBack)
     {
         ViewState["StrWhere"] = string.Format(" EnterpriseID='{0}'", ID);
         Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID);
         BindDropDownList();
         this.ddlCategoryID.Enabled = false;
         this.ddlEnableMonths.Enabled = false;
         if (ID != "")
         {
             DataTable dt = dal.GetRecord(ViewState["StrWhere"].ToString());
             BindData(dt);
             this.txtEnterpriseID.ReadOnly = true;
         }
         else
         {
             this.txtEnterpriseID.Text = dal.GetMaxID();
             this.txtLastModifyUserName.Text = Session["User"].ToString();
             this.txtLastModifyDate.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm");
             this.txtCreateUserName.Text = Session["User"].ToString();
             this.txtCreateDate.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm");
         }
     }
 }
예제 #9
0
    public static void SystemMessage(string[] ToUserName, int ReceiverFlag, string[] ReceiveUnitNo, string Title, string Content)
    {
        Js.BLL.BaseDal dal = new Js.BLL.BaseDal("Sys_AnnounceMessage");

        string strAnnounceUnitNo = "";
        string strAnnounceID = "";
        string strAnnouncer = "";

        string strWhere = " AnnounceID like '" + strAnnounceUnitNo + DateTime.Now.ToString("yyyyMMdd") + "%'";
        dal.GetMaxID(strWhere);

        strAnnounceID = dal.GetMaxID(strWhere);
        if (strAnnounceID.Length <= 0)
            strAnnounceID = strAnnounceUnitNo + DateTime.Now.ToString("yyyyMMdd") + "0001";

        if (HttpContext.Current.Session["UserType"].ToString() == "BU")
        {
            Js.BLL.BusinessUnit.CompanyDal cdal = new Js.BLL.BusinessUnit.CompanyDal();
            Js.Model.BusinessUnit.CompanyInfo model = cdal.GetModel();
            strAnnounceUnitNo = model.CompanyNo;
            Js.BLL.Account.UserDal udal = new Js.BLL.Account.UserDal();
            Js.Model.Account.UsersInfo umodel = udal.GetModel(HttpContext.Current.Session["User"].ToString());
            strAnnouncer = umodel.PersonName;
        }
        else
        {
            strAnnounceUnitNo = HttpContext.Current.Session["EnterpriseID"].ToString();

            Js.BLL.Account.UserDal udal = new Js.BLL.Account.UserDal(HttpContext.Current.Session["EnterpriseID"].ToString());
            Js.Model.Account.UsersInfo umodel = udal.GetModel(HttpContext.Current.Session["User"].ToString());
            strAnnouncer = umodel.PersonName;
        }

        DataTable dt = dal.GetRecord("1=2");
        DataRow dr = dt.NewRow();
        dr["AnnounceID"] = strAnnounceID;
        dr["Announcer"] = strAnnouncer;
        if (HttpContext.Current.Session["UserType"].ToString() == "BU")
            dr["AnnounceFlag"] = 0;
        else
            dr["AnnounceFlag"] = 1;
        dr["AnnounceUnitNo"] = strAnnounceUnitNo;
        dr["AnnouncerUserName"] = HttpContext.Current.Session["User"].ToString();

        dr["Source"] = 1;
        dr["AnnounceDate"] = DateTime.Now;
        dr["Title"] = Title;
        dr["Contents"] = Content;

        dal.Add(dr);

        DataTable dtSub = dal.GetSubDetail("").Tables[0];

        for (int i = 0; i < ToUserName.Length; i++)
        {

            DataRow subdr = dtSub.NewRow();
            subdr["AnnounceID"] = strAnnounceID;
            subdr["ReceiverUserName"] = ToUserName[i];
            subdr["ReceiverFlag"] = ReceiverFlag;

            subdr["ReceiveUnitNo"] = ReceiveUnitNo[i];
            Js.BLL.Account.UserDal udal = new Js.BLL.Account.UserDal(ReceiveUnitNo[i]);
            Js.Model.Account.UsersInfo umodel = udal.GetModel(ToUserName[i]);
            subdr["Receiver"] = umodel.PersonName;

            dtSub.Rows.Add(subdr);

        }
        dal.SaveDetail(dtSub, "");
    }
예제 #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     UserName = Request.QueryString["UserName"] + "";
     FormID = Request.QueryString["FormID"] + "";
     NodeUser = Request.QueryString["NodeUser"] + "";
     if (!IsPostBack)
     {
         ViewState["StrWhere"] = string.Format(" UserName='******'", NodeUser);
         Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID);
         this.txtPersonName.Attributes.Add("readonly", "true");
         this.ddlUserLevel.Enabled = false;
         if (UserName != "")
         {
             DataTable dt = dal.GetRecord(ViewState["StrWhere"].ToString());
             BindData(dt);
             this.txtUserName.ReadOnly = true;
             if (this.txtCreateDate.Text.Trim().Length == 0)
             {
                 this.txtCreateUserName.Text = Session["User"].ToString();
                 this.txtCreateDate.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm");
             }
         }
         else
         {
             //if (NodeUser.ToLower() == "administrator")
             if (Session["User"].ToString().ToLower() == "administrator")
                 this.ddlUserLevel.SelectedIndex = 1;
             else
                 this.ddlUserLevel.SelectedIndex = 2;
             this.txtUserName.Text = dal.GetMaxID();
             this.txtLastModifyUserName.Text = Session["User"].ToString();
             this.txtLastModifyDate.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm");
             this.txtCreateUserName.Text = Session["User"].ToString();
             this.txtCreateDate.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm");
         }
         BindDropDownList();
     }
 }