Пример #1
0
        public List <Project.Entity.Estimate> getEstimate()
        {
            objResponse Response = new objResponse();
            List <Project.Entity.Estimate> Estimate = new List <Project.Entity.Estimate>();

            try
            {
                DATA_ACCESS_LAYER.Fill(Response.ResponseData, "usp_GetEstimate", DB_CONSTANTS.ConnectionString_ERP_CRUZATA);


                if (Response.ResponseData.Tables[0].Rows.Count > 0)
                {
                    Response.ErrorCode = 0;
                    foreach (DataRow dr in Response.ResponseData.Tables[0].Rows)
                    {
                        Project.Entity.Estimate objEstimate = new Project.Entity.Estimate();
                        objEstimate.Estimate_ID_Auto_PK = Convert.ToInt64(dr["Estimation_ID_Auto_PK"]);
                        objEstimate.Lead         = Convert.ToString(dr["Lead"]);
                        objEstimate.Client       = Convert.ToString(dr["Client"]);
                        objEstimate.Priority     = Convert.ToString(dr["Priority"]);
                        objEstimate.Date         = Convert.ToDateTime(dr["Date"]);
                        objEstimate.CategoryName = Convert.ToString(dr["CategoryName"]);
                        objEstimate.LanguageName = Convert.ToString(dr["Language"]);
                        objEstimate.Assigne      = Convert.ToString(dr["FullName"]);
                        objEstimate.Status       = Convert.ToString(dr["Status"]);


                        Estimate.Add(objEstimate);
                    }
                }
                else
                {
                    Response.ErrorCode    = 2001;
                    Response.ErrorMessage = "There is an Error. Please Try After some time.";
                }
            }
            catch (Exception ex)
            {
                Response.ErrorCode    = 3001;
                Response.ErrorMessage = ex.Message.ToString();
                BAL.Common.LogManager.LogError("getEstimate", 1, Convert.ToString(ex.Source), Convert.ToString(ex.Message), Convert.ToString(ex.StackTrace));
            }
            return(Estimate);
        }
Пример #2
0
        public objResponse UpdateEstimate(Project.Entity.Estimate objEstimate, string LogedUser, string Field)
        {
            objResponse Response = new objResponse();

            try
            {
                SqlParameter[] sqlParameter = new SqlParameter[10];

                sqlParameter[0]       = new SqlParameter("@Date", SqlDbType.Date, 50);
                sqlParameter[0].Value = objEstimate.Date;

                sqlParameter[1]       = new SqlParameter("@Category", SqlDbType.BigInt, 80);
                sqlParameter[1].Value = objEstimate.Category;

                sqlParameter[2]       = new SqlParameter("@Language", SqlDbType.Int, 50);
                sqlParameter[2].Value = objEstimate.Language;

                sqlParameter[3]       = new SqlParameter("@AssignTo", SqlDbType.BigInt, 13);
                sqlParameter[3].Value = objEstimate.AssignTo;

                sqlParameter[4]       = new SqlParameter("@Requirment", SqlDbType.NVarChar, 4000);
                sqlParameter[4].Value = objEstimate.Requirment;

                sqlParameter[5]       = new SqlParameter("@CreatedBy", SqlDbType.NVarChar, 60);
                sqlParameter[5].Value = LogedUser;

                sqlParameter[6]       = new SqlParameter("@CreatedDate", SqlDbType.DateTime, 50);
                sqlParameter[6].Value = DateTime.Now;

                sqlParameter[7]       = new SqlParameter("@Priority", SqlDbType.NVarChar, 20);
                sqlParameter[7].Value = objEstimate.Priority;

                sqlParameter[8]       = new SqlParameter("@Estimate_ID_Auto_PK", SqlDbType.BigInt, 10);
                sqlParameter[8].Value = objEstimate.Estimate_ID_Auto_PK;

                sqlParameter[9]       = new SqlParameter("@Field", SqlDbType.NVarChar, 100);
                sqlParameter[9].Value = Field;



                DATA_ACCESS_LAYER.Fill(Response.ResponseData, "usp_UpdateEstimate", sqlParameter, DB_CONSTANTS.ConnectionString_ERP_CRUZATA);


                if (Response.ResponseData.Tables[0].Rows.Count > 0)
                {
                    Response.ErrorCode    = 0;
                    Response.ErrorMessage = Response.ResponseData.Tables[0].Rows[0][0].ToString();
                }
                else
                {
                    Response.ErrorCode    = 2001;
                    Response.ErrorMessage = "There is an Error. Please Try After some time.";
                }
            }
            catch (Exception ex)
            {
                Response.ErrorCode    = 3001;
                Response.ErrorMessage = ex.Message.ToString();
                BAL.Common.LogManager.LogError("UpdateEstimate", 1, Convert.ToString(ex.Source), Convert.ToString(ex.Message), Convert.ToString(ex.StackTrace));
            }
            return(Response);
        }