Esempio n. 1
0
        private void frmCompany_Load(object sender, EventArgs e)
        {
            #region 权限控制
            tlbSaveSysRts.Visible = UserInformation.UserName == "Admin5118";
            string        sErr = "";
            StringBuilder sSql = new StringBuilder("select * from TPB_Rights where cPRId ='" + ModuleRtsId.Trim() + "'");
            if (UserInformation.UserName != "Admin5118")
            {
                sSql.Append(" and cRId in (select cRId from TPB_URTS where cUserId='" + UserInformation.UserId.Trim() + "')");
            }
            DataSet dsX = PubDBCommFuns.GetDataBySql(AppInformation.SvrSocket, sSql.ToString(), "UserRights", "", out sErr);
            if (sErr.Trim() != "" && sErr.Trim() != "0")
            {
                MessageBox.Show(sErr);
            }
            if (UserInformation.UserName != "Admin5118")
            {
                CheckRights(tlbMain, dsX.Tables["UserRights"]);
            }
            #endregion


            strConnFix = "";
            if (UserInformation.UType != UserType.utSupervisor)
            {
                strConnFix = " where cComptId='" + UserInformation.UnitId + "'";
            }
            else
            {
                sbConndition.Remove(0, sbConndition.Length);
            }
            OpenMainDataSet(strConnFix);
        }
Esempio n. 2
0
        private void FrmStockInfo_Load(object sender, EventArgs e)
        {
            #region 权限控制
            tlbSaveSysRts.Visible = UserInformation.UserName == "Admin5118";
            string        sErr = "";
            StringBuilder sSql = new StringBuilder("select * from TPB_Rights where cPRId ='" + ModuleRtsId.Trim() + "'");
            if (UserInformation.UserName != "Admin5118")
            {
                sSql.Append(" and cRId in (select cRId from TPB_URTS where cUserId='" + UserInformation.UserId.Trim() + "')");
            }
            DataSet dsX = PubDBCommFuns.GetDataBySql(AppInformation.SvrSocket, sSql.ToString(), "UserRights", "", out sErr);
            if (sErr.Trim() != "" && sErr.Trim() != "0")
            {
                MessageBox.Show(sErr);
            }
            CheckRights(tlbMain, dsX.Tables["UserRights"]);
            #endregion

            LoadCommboxItemByValue();
            LoadStockList("");
            LoadCheckType("");
            dtp_To.Value   = DateTime.Now;
            dtp_From.Value = DateTime.Now.AddDays(-30);
            BandDataSet("", this.dataGridView_Main);
        }
Esempio n. 3
0
 private void frmCuSuAvailability_Load(object sender, EventArgs e)
 {
     #region 权限控制
     tlbSaveSysRts.Visible = UserInformation.UserName == "Admin5118";
     string        sErr = "";
     StringBuilder sSql = new StringBuilder("select * from TPB_Rights where cPRId ='" + ModuleRtsId.Trim() + "'");
     if (UserInformation.UserName != "Admin5118")
     {
         sSql.Append(" and cRId in (select cRId from TPB_URTS where cUserId='" + UserInformation.UserId.Trim() + "')");
     }
     DataSet dsX = PubDBCommFuns.GetDataBySql(AppInformation.SvrSocket, sSql.ToString(), "UserRights", "", out sErr);
     if (sErr.Trim() != "" && sErr.Trim() != "0")
     {
         MessageBox.Show(sErr);
     }
     if (UserInformation.UserName != "Admin5118")
     {
         CheckRights(tlbMain, dsX.Tables["UserRights"]);
     }
     #endregion
     LoadItemToComb();
     DisplayCSInfo(_CSId.Trim());
     OpenMainDataSet();
 }
Esempio n. 4
0
        private void frmSupplier_Load(object sender, EventArgs e)
        {
            string sErr = "";

            #region 权限控制
            tlbSaveSysRts.Visible = UserInformation.UserName == "Admin5118";
            StringBuilder sSql = new StringBuilder("select * from TPB_Rights where cPRId ='" + ModuleRtsId.Trim() + "'");
            if (UserInformation.UserName != "Admin5118")
            {
                sSql.Append(" and cRId in (select cRId from TPB_URTS where cUserId='" + UserInformation.UserId.Trim() + "')");
            }
            DataSet dsX = PubDBCommFuns.GetDataBySql(AppInformation.SvrSocket, sSql.ToString(), "UserRights", "", out sErr);
            if (sErr.Trim() != "" && sErr.Trim() != "0")
            {
                MessageBox.Show(sErr);
            }
            if (UserInformation.UserName != "Admin5118")
            {
                CheckRights(tlbMain, dsX.Tables["UserRights"]);
            }
            #endregion
            //自动更新客户和供应商的可用性
            string sX = DBFuns.sp_UpdateCuSupplyerUseful(AppInformation.SvrSocket, out sErr);
            if (sErr.Trim() != "" && sErr.Trim() != "0")
            {
                MessageBox.Show("自动更新客户及供应商合法性时出错:" + sErr);
            }
            else
            {
                if (sX.Trim() != "0")
                {
                    MessageBox.Show("新增了" + sX + " 个 不可用客户或供应商(包括生产商)");
                }
            }
            OpenMainDataSet();
        }