コード例 #1
0
        public String processDeductionWeges(String EmpNo, String Division)
        {
            String              Status      = "";
            SqlParameter        param       = new SqlParameter();
            SqlParameter        statusParam = new SqlParameter();
            List <SqlParameter> paramList   = new List <SqlParameter>();

            param       = SQLHelper.CreateParameter("@wegesFromDate", SqlDbType.DateTime);
            param.Value = Convert.ToDateTime(DtProcessFromDate.ToShortDateString());
            paramList.Add(param);
            param       = SQLHelper.CreateParameter("@wegesToDate", SqlDbType.DateTime);
            param.Value = Convert.ToDateTime(DtProcessToDate.ToShortDateString());
            paramList.Add(param);
            param       = SQLHelper.CreateParameter("@divisionId", SqlDbType.VarChar, 50);
            param.Value = Division;
            paramList.Add(param);
            param       = SQLHelper.CreateParameter("@ProEmpNO", SqlDbType.VarChar, 50);
            param.Value = EmpNo;
            paramList.Add(param);
            param       = SQLHelper.CreateParameter("@Process", SqlDbType.Bit);
            param.Value = BoolProcess;
            paramList.Add(param);
            param       = SQLHelper.CreateParameter("@userId", SqlDbType.VarChar, 50);
            param.Value = User.StrUserName;
            paramList.Add(param);
            SqlCommand cmd = new SqlCommand();

            cmd                   = SQLHelper.CreateCommand("spProcessDeductMonthlyDeductions", CommandType.StoredProcedure, paramList);
            statusParam           = cmd.Parameters.Add("@state", SqlDbType.VarChar, 50);
            statusParam.Direction = ParameterDirection.Output;
            SQLHelper.ExecuteNonQuery(cmd);
            Status = statusParam.Value.ToString();
            cmd.Dispose();
            return(Status);
        }
コード例 #2
0
        public String DeletePreviewMonthlyWegesData()
        {
            // using (TransactionScope trnScope = new TransactionScope())
            //{
            String              Status      = "";
            SqlParameter        param       = new SqlParameter();
            SqlParameter        statusParam = new SqlParameter();
            List <SqlParameter> paramList   = new List <SqlParameter>();

            param       = SQLHelper.CreateParameter("@wegesFromDate", SqlDbType.DateTime);
            param.Value = Convert.ToDateTime(DtProcessFromDate.ToShortDateString());
            paramList.Add(param);
            param       = SQLHelper.CreateParameter("@wegesToDate", SqlDbType.DateTime);
            param.Value = Convert.ToDateTime(DtProcessToDate.ToShortDateString());
            paramList.Add(param);
            param       = SQLHelper.CreateParameter("@divisionId", SqlDbType.VarChar, 50);
            param.Value = StrDivision;
            paramList.Add(param);
            param       = SQLHelper.CreateParameter("@userId", SqlDbType.VarChar, 50);
            param.Value = User.StrUserName;
            paramList.Add(param);
            SqlCommand cmd = new SqlCommand();

            cmd                   = SQLHelper.CreateCommand("spPreviewDeletePreviewData", CommandType.StoredProcedure, paramList);
            statusParam           = cmd.Parameters.Add("@state", SqlDbType.VarChar, 50);
            statusParam.Direction = ParameterDirection.Output;
            SQLHelper.ExecuteNonQuery(cmd);
            Status = statusParam.Value.ToString();
            cmd.Dispose();
            return(Status);
            // trnScope.Complete();
            //}
        }
コード例 #3
0
        public String processDeductionWeges(String EmpNo)
        {
            // using (TransactionScope trnScope = new TransactionScope())
            //{
            String              Status      = "";
            SqlParameter        param       = new SqlParameter();
            SqlParameter        statusParam = new SqlParameter();
            List <SqlParameter> paramList   = new List <SqlParameter>();

            param       = SQLHelper.CreateParameter("@wegesFromDate", SqlDbType.DateTime);
            param.Value = Convert.ToDateTime(DtProcessFromDate.ToShortDateString());
            paramList.Add(param);
            param       = SQLHelper.CreateParameter("@wegesToDate", SqlDbType.DateTime);
            param.Value = Convert.ToDateTime(DtProcessToDate.ToShortDateString());
            paramList.Add(param);
            param       = SQLHelper.CreateParameter("@divisionId", SqlDbType.VarChar, 50);
            param.Value = StrDivision;
            paramList.Add(param);
            param       = SQLHelper.CreateParameter("@ProEmpNo", SqlDbType.VarChar, 50);
            param.Value = EmpNo;
            paramList.Add(param);
            param       = SQLHelper.CreateParameter("@Process", SqlDbType.Bit);
            param.Value = BoolProcess;
            paramList.Add(param);
            param       = SQLHelper.CreateParameter("@userId", SqlDbType.VarChar, 50);
            param.Value = User.StrUserName;
            paramList.Add(param);
            SqlCommand cmd = new SqlCommand();

            cmd                   = SQLHelper.CreateCommand("spProcessDeductMonthlyDeductions_Priority", CommandType.StoredProcedure, paramList);
            statusParam           = cmd.Parameters.Add("@state", SqlDbType.VarChar, 50);
            statusParam.Direction = ParameterDirection.Output;
            SQLHelper.ExecuteNonQuery(cmd);
            Status = statusParam.Value.ToString();
            cmd.Dispose();
            return(Status);
            // trnScope.Complete();
            //}

            //String Status = "";
            //SqlParameter param = new SqlParameter();
            //SqlParameter statusParam = new SqlParameter();
            //List<SqlParameter> paramList = new List<SqlParameter>();
            //param = SQLHelper.CreateParameter("@wegesFromDate", SqlDbType.DateTime);
            //param.Value = Convert.ToDateTime(DtProcessFromDate.ToShortDateString());
            //paramList.Add(param);
            //param = SQLHelper.CreateParameter("@wegesToDate", SqlDbType.DateTime);
            //param.Value = Convert.ToDateTime(DtProcessToDate.ToShortDateString());
            //paramList.Add(param);
            //param = SQLHelper.CreateParameter("@divisionId", SqlDbType.VarChar, 50);
            //param.Value = StrDivision;
            //paramList.Add(param);
            //param = SQLHelper.CreateParameter("@ProEmpNO", SqlDbType.VarChar, 50);
            //param.Value = EmpNo;
            //paramList.Add(param);
            //param = SQLHelper.CreateParameter("@Process", SqlDbType.Bit);
            //param.Value = BoolProcess;
            //paramList.Add(param);
            //param = SQLHelper.CreateParameter("@userId", SqlDbType.VarChar, 50);
            //param.Value = User.StrUserName;
            //paramList.Add(param);
            //SqlCommand cmd = new SqlCommand();
            //if (IsPriorityDeduction())
            //{
            //    cmd = SQLHelper.CreateCommand("spProcessDeductMonthlyDeductions_Priority", CommandType.StoredProcedure, paramList);
            //}
            //else
            //{
            //    cmd = SQLHelper.CreateCommand("spProcessDeductMonthlyDeductions", CommandType.StoredProcedure, paramList);
            //}
            //statusParam = cmd.Parameters.Add("@state", SqlDbType.VarChar, 50);
            //statusParam.Direction = ParameterDirection.Output;
            //SQLHelper.ExecuteNonQuery(cmd);
            //Status = statusParam.Value.ToString();
            //cmd.Dispose();
            //return Status;
        }