Summary description for DataAccess
Ejemplo n.º 1
0
        public int CopyAndUpdateFields(int SourceID, int? NguoiDungID, string HovaTenNguoiNhan, string DiaChiNguoiNhan,
            string EmailNguoiNhan, string DTDDNguoiNhan, string CMTND)
        {
            DataAccess objDataAccess = new DataAccess();
            using (SqlCommand sqlCmd = new SqlCommand())
            {
                int iID = 0;
                sqlCmd.CommandType = CommandType.StoredProcedure;
                sqlCmd.CommandText = "CopyAndUpdateFieldsDonHang";

                sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
                sqlCmd.Parameters.Add("@NguoiDungID", SqlDbType.Int).Value = NguoiDungID;

                sqlCmd.Parameters.Add("@HovaTenNguoiNhan", SqlDbType.NVarChar, 50).Value = HovaTenNguoiNhan;

                sqlCmd.Parameters.Add("@DiaChiNguoiNhan", SqlDbType.NVarChar, 1000).Value = DiaChiNguoiNhan;

                sqlCmd.Parameters.Add("@EmailNguoiNhan", SqlDbType.NVarChar, 50).Value = EmailNguoiNhan;

                sqlCmd.Parameters.Add("@DTDDNguoiNhan", SqlDbType.NVarChar, 50).Value = DTDDNguoiNhan;

                sqlCmd.Parameters.Add("@CMTND", SqlDbType.VarChar, 9).Value = CMTND;

                iID = objDataAccess.ExecuteScalar(sqlCmd);
                return iID;
            }
        }
Ejemplo n.º 2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        DataAccess dataaccess = new DataAccess();

        using (SqlConnection Sqlcon = dataaccess.OpenConnection())
        {
            using (SqlCommand cmd = new SqlCommand())
            {

                cmd.Connection = Sqlcon;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "InsertITJob";
                cmd.Parameters.Add(new SqlParameter("@Exists", SqlDbType.Int));
                cmd.Parameters.Add(new SqlParameter("@ITJobHeading", SqlDbType.VarChar, 100));
                cmd.Parameters.Add(new SqlParameter("@ITJobDesc", SqlDbType.NVarChar, 50));
                cmd.Parameters.Add(new SqlParameter("@ITJobDate", SqlDbType.DateTime));

                cmd.Parameters["@ITJobHeading"].Value = txtITJob.Text;
                cmd.Parameters["@ITJobDesc"].Value = txtITDesc.Text;
                cmd.Parameters["@ITJobDate"].Value = System.DateTime.Now;

                cmd.Parameters["@Exists"].Value = 0;
                cmd.ExecuteNonQuery();
                int retVal = (int)cmd.Parameters["@Exists"].Value;
            }
        }
        LoadData();
        PanelShow.Visible = true;
        PanelAdd.Visible = false;
        txtITJob.Text = "";
        txtITDesc.Text = "";
    }
Ejemplo n.º 3
0
    protected void PopulateControls(DataAccess.Classes.Product pr)
    {
        ltrTenSanPham.Text = pr.ProductName;
        ltrMaSanPham.Text = pr.ProductCode;
        ltrOldPrice.Text = showMoney(pr.OldPrice).ToString();
        ltrNewPrice.Text = showMoney(pr.NewPrice).ToString();
        ltrDiscount.Text = pr.Discount.ToString();
        ltrMoTa.Text = pr.Description;
        ltrChiTietSanPham.Text = pr.Detail;
        ltrXuatXu.Text = pr.Origin;
        ltrBaoHanh.Text = pr.Guarantee;

        List<Img> album = new List<Img>();
        int idimg = 0;
        string listimg = pr.Image;
        string[] str = listimg.Split('\'');
        foreach (var item in str)
        {
            if (item.ToString() != "")
            {
                Img dataimg = new Img();
                dataimg.ID = idimg;
                dataimg.Ten = pr.ProductName;
                dataimg.HinhAnh = item.ToString();
                album.Add(dataimg);
                idimg++;
            }
        }
        rptListImg.DataSource = album;
        rptListImg.DataBind();

        figureLarge.HRef = str.First().Trim().ToString();
        //figureLarge.Title = pr.ProductName;
        figureThumb.Src = ToThumb(str.First().Trim().ToString());
    }
 protected void btn_Save_Click1(object sender, EventArgs e)
 {
     DataAccess da = new DataAccess();
     String res = da.updateAccountabilityInfo(Convert.ToInt32(hf_Accountability_Id.Value),
                                             Convert.ToInt32(ddl_Acct_Next_Level.SelectedValue),
                                             txt_Note.Text);
 }
Ejemplo n.º 5
0
    public void LoadPostedJob()
    {
        DataAccess dataaccess = new DataAccess();

        using (SqlConnection Sqlcon = dataaccess.OpenConnection())
        {
            using (SqlCommand cmd = new SqlCommand())
            {

                cmd.Connection = Sqlcon;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "getPostJob";
                cmd.Parameters.Add(new SqlParameter("@Action", SqlDbType.VarChar, 50));
                cmd.Parameters.Add(new SqlParameter("@CompanyId", SqlDbType.Int));

                cmd.Parameters["@CompanyId"].Value = int.Parse(CompanyId);

                cmd.Parameters["@Action"].Value = "select";
                cmd.Parameters.Add("@Exists", SqlDbType.Int).Direction = ParameterDirection.Output;
                SqlAda = new SqlDataAdapter(cmd);
                ds = new DataSet();
                SqlAda.Fill(ds);
                GrdLoadJobCompany.DataSource = ds;
                GrdLoadJobCompany.DataBind();
            }
        }
    }
Ejemplo n.º 6
0
    public void LoadQuali()
    {
        DataAccess dataaccess = new DataAccess();

        using (SqlConnection Sqlcon = dataaccess.OpenConnection())
        {
            using (SqlCommand cmd = new SqlCommand())
            {

                cmd.Connection = Sqlcon;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "GetQualification";
                cmd.Parameters.Add(new SqlParameter("@Action", SqlDbType.VarChar, 50));
                cmd.Parameters["@Action"].Value = "select";
                cmd.Parameters.Add("@Exists", SqlDbType.Int).Direction = ParameterDirection.Output;
                SqlAda = new SqlDataAdapter(cmd);
                ds = new DataSet();
                SqlAda.Fill(ds);
                ddlQul.DataSource = ds;
                ddlQul.DataTextField = "QualificationName";
                ddlQul.DataValueField = "QualificationId";
                ddlQul.DataBind();
                if (ddlQul.Items.Count >= 1)
                {
                    ListItem lstitem = new ListItem();
                    lstitem.Text = "[Select]";
                    lstitem.Value = "0";
                    ddlQul.Items.Insert(0, lstitem);
                }
            }
        }
    }
Ejemplo n.º 7
0
        public void Assignment_SelectAddSelectDeleteSelect_OK()
        {
            using (System.Transactions.TransactionScope updateTransaction =
             new System.Transactions.TransactionScope())
            {
                string connectionString = GetConnectionstring();
                DataAccess d2 = new DataAccess(connectionString);

                List<Assignment> assignmentsBefore = d2.GetAssignments();

                Assignment assignment = new Assignment();
                assignment.AssignmentId = -1;
                assignment.AssignmentName = "asfdasfasdfsaf";

                Assignment assignmentAfterSave = d2.SaveAssignment(assignment);

                Assignment assignmentGetById = d2.GetAssignmentByID(assignment.AssignmentId);

                Assert.AreNotEqual(assignment.AssignmentId, -1);
                Assert.AreEqual(assignment.AssignmentName, assignmentGetById.AssignmentName);

                List<Assignment> assignmentsAfterSave = d2.GetAssignments();

                Assert.AreEqual(assignmentsAfterSave.Count, assignmentsBefore.Count + 1);

                d2.DeleteAssignment(assignment.AssignmentId);

                List<Assignment> assignmentsAfterDelete = d2.GetAssignments();

                Assert.AreEqual(assignmentsBefore.Count, assignmentsAfterDelete.Count);

            }
        }
Ejemplo n.º 8
0
    public void LoadStatus()
    {
        string StudentId = Session["StudentId"].ToString();

        DataAccess dataaccess = new DataAccess();

        using (SqlConnection Sqlcon = dataaccess.OpenConnection())
        {
            using (SqlCommand cmd = new SqlCommand())
            {

                cmd.Connection = Sqlcon;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "getStatus";
                cmd.Parameters.Add(new SqlParameter("@StudentId",SqlDbType.Int));

                cmd.Parameters.Add(new SqlParameter("@Action", SqlDbType.VarChar, 50));
                cmd.Parameters["@Action"].Value = "select";
                cmd.Parameters["@StudentId"].Value = StudentId;
                cmd.Parameters.Add("@Exists", SqlDbType.Int).Direction = ParameterDirection.Output;
                SqlAda = new SqlDataAdapter(cmd);
                ds = new DataSet();
                SqlAda.Fill(ds);
                GrdLoadJobCompany.DataSource = ds;
                GrdLoadJobCompany.DataBind();
            }
        }
    }
Ejemplo n.º 9
0
    public void LoadRejectedCompany()
    {
        DataAccess dataaccess = new DataAccess();

        using (SqlConnection Sqlcon = dataaccess.OpenConnection())
        {
            using (SqlCommand cmd = new SqlCommand())
            {

                cmd.Connection = Sqlcon;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "getCompany";
                cmd.Parameters.Add(new SqlParameter("@Action", SqlDbType.VarChar, 50));
                cmd.Parameters.Add(new SqlParameter("@Active", SqlDbType.Int));

                cmd.Parameters["@Active"].Value = 2;

                cmd.Parameters["@Action"].Value = "select";
                cmd.Parameters.Add("@Exists", SqlDbType.Int).Direction = ParameterDirection.Output;
                SqlAda = new SqlDataAdapter(cmd);
                ds = new DataSet();
                SqlAda.Fill(ds);

                grdRejected.DataSource = ds;
                grdRejected.DataBind();

            }
        }
    }
Ejemplo n.º 10
0
 public Risk(DataAccess.Risk risk)
 {
     Id = risk.RiskId;
     ProjectId = risk.ProjectId;
     Title = risk.Title;
     Description = risk.Description;
 }
    protected void btnEmployee_Click(object sender, EventArgs e)
    {
        Response.Write("{\"employees\": [");
        string connectionstring = System.Configuration.ConfigurationManager.ConnectionStrings["OrtegaGoDaddy"].ConnectionString;
        DataAccess da = new DataAccess();

        System.Data.DataSet ds = da.getDataSet(connectionstring, "select employeeId, employeeFname, employeeLname from Ortega_Employees");

        if (ds.Tables.Count <= 0 || ds.Tables[0].Rows.Count <= 0)
        {
            Response.Write("{}");
        }
        else
        {
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                Response.Write("{\"employeeid\": \"" +
                    ds.Tables[0].Rows[i].ItemArray[0].ToString() + "\",\"firstname\":" + "\"" + ds.Tables[0].Rows[i].ItemArray[1].ToString() + "\"}");

                if (i < ds.Tables[0].Rows.Count - 1)
                {
                    Response.Write(",");
                }

            }
        }

        Response.Write("]}");
    }
 protected static void Copy(DataAccess.Semester obj, Semester newObj)
 {
     newObj.ID = obj.ID;
     newObj.Begin = obj.Begin;
     newObj.End = obj.End;
     newObj.Name = obj.Name;
 }
Ejemplo n.º 13
0
        public int CopyAndUpdateFields(int SourceID, int? NguoiDungID, int? DauGiaID, decimal? TraGia,
            DateTime? ThoiGianTraGia, string Bak1, string Bak2, int? Bak3, bool? Bak4)
        {
            DataAccess objDataAccess = new DataAccess();
            using (SqlCommand sqlCmd = new SqlCommand())
            {
                int iID = 0;
                sqlCmd.CommandType = CommandType.StoredProcedure;
                sqlCmd.CommandText = "CopyAndUpdateFieldsTraGia";

                sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
                sqlCmd.Parameters.Add("@NguoiDungID", SqlDbType.Int).Value = NguoiDungID;

                sqlCmd.Parameters.Add("@DauGiaID", SqlDbType.Int).Value = DauGiaID;

                sqlCmd.Parameters.Add("@TraGia", SqlDbType.Money).Value = TraGia;

                sqlCmd.Parameters.Add("@ThoiGianTraGia", SqlDbType.DateTime).Value = ThoiGianTraGia;

                sqlCmd.Parameters.Add("@Bak1", SqlDbType.NVarChar, 50).Value = Bak1;

                sqlCmd.Parameters.Add("@Bak2", SqlDbType.NVarChar, 50).Value = Bak2;

                sqlCmd.Parameters.Add("@Bak3", SqlDbType.Int).Value = Bak3;

                sqlCmd.Parameters.Add("@Bak4", SqlDbType.Bit).Value = Bak4;

                iID = objDataAccess.ExecuteScalar(sqlCmd);
                return iID;
            }
        }
        internal IPassthroughAction CreateJobHistoryAction(Uri requestUri, DataAccess.Context.ClusterContainer container,
                                                           string subscriptionId)
        {
            Contract.AssertArgNotNull(requestUri, "requestUri");
            Contract.AssertArgNotNull(requestUri.Segments, "requestUri.Segments");
            
            var lastSegs =
                requestUri.Segments.SkipWhile(i => i.ToLowerInvariant().Trim('/') != JobSubmissionConstants.ResourceExtentionName)
                          .ToList();
            Contract.AssertArgNotNull(lastSegs, "lastSegs");

            //If there is one segment, then we know that no JobId was passed, and we should list job history.
            if (lastSegs.Count() == 1)
            {
                return new ListJobsPassthroughAction(container, subscriptionId);
            }

            //If there are two segments, then an jobId was passed, and we should get job details.
            if (lastSegs.Count() == 2)
            {
                return new JobDetailsPassthroughAction(lastSegs.Last().Trim('/'), container, subscriptionId);
            }

            //If zero or more then two segments are present, then the request is invalid, and an action cannot be found to support it.
            throw new PassthroughActionProcessingException(string.Format(JobSubmissionConstants.JobHistoryRequestActionNotFound, container.DnsName, requestUri));
        }
        public DataAccess.DataContracts.IPerson AddPerson(DataAccess.DataContracts.IPerson person)
        {
            _people.Add(person);
            person.PersonId = _people.Count();

            return person;
        }
Ejemplo n.º 16
0
    private bool YourValidationFunction(string UserName, string Password, int Active)
    {
        DataAccess dataaccess = new DataAccess();
            SqlConnection Sqlcon = dataaccess.OpenConnection();
            bool boolReturnValue = false;
            String SQLQuery = "SELECT CompanyId, CompanyEmail, Password, Active FROM CompanyMaster where CompanyEmail='"+Login1.UserName+"' and Password='******' and Active='"+Active+"'";
            SqlCommand command = new SqlCommand(SQLQuery, Sqlcon);
            SqlDataReader Dr;

        Dr = command.ExecuteReader();

        while (Dr.Read())

        {

            if ((UserName == Dr["CompanyEmail"].ToString()) & (Password == Dr["Password"].ToString()) )

            {
                Session["CompanyId"] = Dr["CompanyId"].ToString();

                boolReturnValue = true;

            }

            Dr.Close();

            return boolReturnValue;

        }

        return boolReturnValue;
    }
Ejemplo n.º 17
0
        /// <summary>
        /// Map an ORM Show to a contract Show
        /// </summary>
        /// <param name="_show"></param>
        /// <returns></returns>
        internal static Contracts.Show MapShow(DataAccess.Show _show)
        {
            var result = new Contracts.Show()
            {
                ShowID = _show.ID,
                Title = _show.Title,
                Category = _show.Category,
                Description = _show.Description,
                Cast = _show.Cast,
                Duration = new TimeSpan(0, (_show.Duration ?? 0), 0), 
                DetailsLink =  new Uri("http://empty.com"),
                Preview = new Uri("http://empty.com"),    
                Logo = _show.Logo
            };

            if (!string.IsNullOrEmpty(_show.Url))
                result.DetailsLink = new Uri(_show.Url);

            if (!string.IsNullOrEmpty(_show.Preview))
              result.Preview =  new Uri(_show.Preview);                   
          

            result.Events = _show.Events.Select(e => CreateEventForShow(e, result)).ToArray();

            return result;

        }
Ejemplo n.º 18
0
        public int CopyAndUpdateFields(int SourceID, int? DonHangID, int? SanPhamID, string TenSanPham,
            decimal? GiaSanPham, int? SoLuong, decimal? TongTien, int? CuaHangID,
            string TenCuaHang)
        {
            DataAccess objDataAccess = new DataAccess();
            using (SqlCommand sqlCmd = new SqlCommand())
            {
                int iID = 0;
                sqlCmd.CommandType = CommandType.StoredProcedure;
                sqlCmd.CommandText = "CopyAndUpdateFieldsChiTietDonHang";

                sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
                sqlCmd.Parameters.Add("@DonHangID", SqlDbType.Int).Value = DonHangID;

                sqlCmd.Parameters.Add("@SanPhamID", SqlDbType.Int).Value = SanPhamID;

                sqlCmd.Parameters.Add("@TenSanPham", SqlDbType.NVarChar, 50).Value = TenSanPham;

                sqlCmd.Parameters.Add("@GiaSanPham", SqlDbType.Money).Value = GiaSanPham;

                sqlCmd.Parameters.Add("@SoLuong", SqlDbType.Int).Value = SoLuong;

                sqlCmd.Parameters.Add("@TongTien", SqlDbType.Money).Value = TongTien;

                sqlCmd.Parameters.Add("@CuaHangID", SqlDbType.Int).Value = CuaHangID;

                sqlCmd.Parameters.Add("@TenCuaHang", SqlDbType.NVarChar, 100).Value = TenCuaHang;

                iID = objDataAccess.ExecuteScalar(sqlCmd);
                return iID;
            }
        }
Ejemplo n.º 19
0
 public Donation CreateDonation(Donation donation)
 {
     using (var db = new DataAccess())
     {
         db.CreateStoredProcCommand("dbo.CreateDonation");
         db.AddInputParameter("@DonationProviderId", donation.DonationProviderId);
         db.AddInputParameter("@UserId", donation.UserId);
         db.AddInputParameter("@ExternalId", donation.ExternalId);
         db.AddInputParameter("@ExternalStatus", donation.ExternalStatus);
         db.AddInputParameter("@IsCompleted", donation.IsCompleted);
         db.AddInputParameter("@CountryId", donation.CountryId);
         db.AddInputParameter("@StateId", donation.StateId);
         db.AddInputParameter("@CityId", donation.CityId);
         db.AddInputParameter("@Amount", donation.Amount);
         db.AddInputParameter("@Currency", donation.Currency);
         db.AddInputParameter("@UserMessage", donation.UserMessage);
         db.AddInputParameter("@ProviderData", donation.ProviderXml);                
         db.AddInputParameter("@DonationSubscriptionId", donation.DonationSubscriptionId);
         db.AddInputParameter("@TransactionType", donation.TransactionType);
         db.AddOutputParameter("@DonationId", DbType.Int32);
         try
         {
             db.ExecuteNonQuery();
             donation.DonationId = db.GetParameterValue<int>("@DonationId");
         }
         catch (Exception ex)
         {
             Log.Error("Error while creating donation.", ex);
             throw;
         }
     }
     return donation;
 }
Ejemplo n.º 20
0
        public int CopyAndUpdateFields(int SourceID, int? QuangCaoID, int? ViTriQuangCao, int? NhomSanPhamID,
            int? khuvucid, int? bak)
        {
            DataAccess objDataAccess = new DataAccess();
            using (SqlCommand sqlCmd = new SqlCommand())
            {
                int iID = 0;
                sqlCmd.CommandType = CommandType.StoredProcedure;
                sqlCmd.CommandText = "CopyAndUpdateFieldsViTriQuangCao";

                sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
                sqlCmd.Parameters.Add("@QuangCaoID", SqlDbType.Int).Value = QuangCaoID;

                sqlCmd.Parameters.Add("@ViTriQuangCao", SqlDbType.Int).Value = ViTriQuangCao;

                sqlCmd.Parameters.Add("@NhomSanPhamID", SqlDbType.Int).Value = NhomSanPhamID;

                sqlCmd.Parameters.Add("@khuvucid", SqlDbType.Int).Value = khuvucid;

                sqlCmd.Parameters.Add("@bak", SqlDbType.Int).Value = bak;

                iID = objDataAccess.ExecuteScalar(sqlCmd);
                return iID;
            }
        }
Ejemplo n.º 21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            DataAccess data = new DataAccess();
            ddChuyenMuc.DataSource = data.GetAllChuyenMuc();
            ddChuyenMuc.DataValueField = "id";
            ddChuyenMuc.DataTextField = "tenCM";
            ddChuyenMuc.DataBind();
            BaiViet bv = new BaiViet();
            bv = data.GetABaiViet(Convert.ToInt32(Request.QueryString["id"]));
            txtTieuDe.Text = bv.tieuDe.ToString();
            ddChuyenMuc.Text = bv.id_cm.ToString();
            oldHinhAnh.ImageUrl = bv.hinhAnh.ToString();
            txtNoiDung.Text = bv.noiDung;
            txtMota.Text = bv.moTa;
            txtTuKhoa.Text = bv.tuKhoa;
            if (bv.trangThai == 1) rd1.Checked = true;
            else rd0.Checked = true;

            //if (rdv.Equals(1)
            //{
            //    rdtrangThai.Items.FindByValue("1").Selected = true;
            //    rdtrangThai.Items.FindByValue("0").Selected = false;
            //}
            //else
            //{
            //    rdtrangThai.Items.FindByValue("0").Selected = true;
            //    rdtrangThai.Items.FindByValue("1").Selected = false;
            //}

        }
    }
    public void LoadJobDetails()
    {
        DataAccess dataaccess = new DataAccess();
        SqlConnection Sqlcon = dataaccess.OpenConnection();

        String SQLQuery = "SELECT p.PostJobId, p.JobTitle,p.JobDesc,p.QulificationId,p.SpecificationId,p.ExpInYear,p.ExpInMonth,p.JobTypeId,p.CompanyId,p.Active,p.Location,C.CompanyName,C.CompanyLogo,Q.QualificationName from PostJobMaster as p inner join CompanyMaster as C on C.CompanyId = p.CompanyId inner join QualificationMaster as Q on Q.QualificationId=p.QulificationId where p.CompanyId =" + PostJobId + "";

        SqlCommand command = new SqlCommand(SQLQuery, Sqlcon);
        SqlDataReader Dr;

        Dr = command.ExecuteReader();

        while (Dr.Read())
        {

            lblJobTitle.Text = Dr["JobTitle"].ToString();
            lblCompName.Text = Dr["CompanyName"].ToString();
            imgCompLogo.ImageUrl = "~/CompanyLogo/" + Dr["CompanyLogo"].ToString();
            lblQuil.Text = Dr["QualificationName"].ToString();
            lblExpYear.Text = Dr["ExpInYear"].ToString();
            lblExpMonths.Text = Dr["ExpInMonth"].ToString();
            lblLocation.Text = Dr["Location"].ToString();
            lblJobDesc.Text = Dr["JobDesc"].ToString();
        }

        Dr.Close();
    }
        /// <summary>
        /// Method that get the correct passthrough action based on the given request. 
        /// </summary>
        /// <param name="resourceExtension">The resource extention that was requested (ie. "/jobs").</param>
        /// <param name="request">The actual http request.</param>
        /// <param name="container">The container that action should be preformed on.</param>
        /// <param name="subscriptionId">The subscription Id that made the request.</param>
        /// <returns></returns>
        public IPassthroughAction GetPassthroughAction(string resourceExtension, HttpRequestMessage request, 
                                                       DataAccess.Context.ClusterContainer container, string subscriptionId)
        {
            Contract.AssertArgNotNull(request,"request");
            Contract.AssertArgNotNull(request.RequestUri,"request.RequestUri");

            switch (resourceExtension.ToLowerInvariant())
            {
                case "jobs":
                    switch (request.Method.ToString().ToLowerInvariant())
                    {
                        case "put":
                            var requestPayload = GetRequestPayload(request);
                            
                            var jobRequest = jobRequestFactory.CreateJobRequest(requestPayload);
                            if (jobRequest == null)
                            {
                                throw new PassthroughActionProcessingException(string.Format(JobSubmissionConstants.InvalidJobRequestLogMessage, requestPayload));
                            }
                            return CreateJobRequestAction(jobRequest, container, subscriptionId);
                        case "get":
                            return CreateJobHistoryAction(request.RequestUri, container, subscriptionId);
                    }
                    break;
            }
            throw new PassthroughActionProcessingException(string.Format(JobSubmissionConstants.PassThroughActionCreationFailedLogMessage, resourceExtension,request.Method));
        }
Ejemplo n.º 24
0
        public int CopyAndUpdateFields(int SourceID, int? SanPhamID, string DuongDan, string Bak1, string Bak2,
            int? Bak3, int? SanPhamMauID)
        {
            DataAccess objDataAccess = new DataAccess();
            using (SqlCommand sqlCmd = new SqlCommand())
            {
                int iID = 0;
                sqlCmd.CommandType = CommandType.StoredProcedure;
                sqlCmd.CommandText = "CopyAndUpdateFieldsAnh";

                sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
                sqlCmd.Parameters.Add("@SanPhamID", SqlDbType.Int).Value = SanPhamID;

                sqlCmd.Parameters.Add("@DuongDan", SqlDbType.NVarChar, 100).Value = DuongDan;

                sqlCmd.Parameters.Add("@Bak1", SqlDbType.NVarChar, 50).Value = Bak1;

                sqlCmd.Parameters.Add("@Bak2", SqlDbType.NVarChar, 50).Value = Bak2;

                sqlCmd.Parameters.Add("@Bak3", SqlDbType.Int).Value = Bak3;

                sqlCmd.Parameters.Add("@SanPhamMauID", SqlDbType.Int).Value = SanPhamMauID;

                iID = objDataAccess.ExecuteScalar(sqlCmd);
                return iID;
            }
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Constructor (Solo para uso Externo) de la Clase BaseClass.
        /// </summary>
        /// <param name="bizSrv"></param>
        /// <param name="callingAssembly"></param>
        /// <param name="creteDBConnection"></param>
        protected BaseClass(BizServer bizSrv, string callingAssembly, bool createDBConnection)
        {
            if (callingAssembly == Assembly.GetExecutingAssembly().GetName().Name)
                throw new Exception("This constructor must be used only from external assembly.");

            try
            {
                if (bizSrv == null)
                    throw new ArgumentNullException("BizServer");

                _oBizServer = bizSrv;

                if (createDBConnection)
                {
                    _oDataAccess = EstudioDelFutbol.Data.ADONETDataAccess.DataAccess.GetSqlClientWrapper(bizSrv.DataBase.ConnectionString, new CacheHelper(), bizSrv.Log);

                    if (bizSrv.Usuario != null)
                        _oDataAccess.TrackingInfo = bizSrv.Usuario.RemoteEndpoint;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 26
0
        public static string CalculateQRests(int SpareID)
        {
            SpareView spare = SpareContainer.Instance.GetSpare(SpareID);
            DataAccess da = new DataAccess();
            string xml = "";
            List<warehouse> warehouses = da.GetWarehouses();
            List<double> Qs = new List<double>();
            xml += "<r>";

            // Q total
            double q0 = spare.QRest.HasValue ? spare.QRest.Value : 0;
            Qs.Add(q0);

            // all actual incomes
            List<SpareInSpareIncomeView> incomes = da.GetActualIncomes();

            // Q by warehouses
            foreach (warehouse w in warehouses)
            {
                // incomes by warehouse
                decimal? q = incomes.Where(i => (i.WarehouseID == w.id && i.SpareID == SpareID)).Sum(i => i.QRest);
                if (q.HasValue)
                    Qs.Add((double)q.Value);
                else
                    Qs.Add(0);
            }

            foreach (double q in Qs)
                xml += "<w q=\"" + q.ToString() + "\"/>";
            xml += @"</r>";

            // save sml to db
            da.SpareEdit(SpareID, xml);
            return xml;
        }
Ejemplo n.º 27
0
        public int CopyAndUpdateFields(int SourceID, string LoaiNguoiDung, int? SapXep, string Bak1, string Bak2,
            int? Bak3)
        {
            DataAccess objDataAccess = new DataAccess();
            using (SqlCommand sqlCmd = new SqlCommand())
            {
                int iID = 0;
                sqlCmd.CommandType = CommandType.StoredProcedure;
                sqlCmd.CommandText = "CopyAndUpdateFieldsLoaiNguoiDung";

                sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
                sqlCmd.Parameters.Add("@LoaiNguoiDung", SqlDbType.NVarChar, 50).Value = LoaiNguoiDung;

                sqlCmd.Parameters.Add("@SapXep", SqlDbType.Int).Value = SapXep;

                sqlCmd.Parameters.Add("@Bak1", SqlDbType.NVarChar, 50).Value = Bak1;

                sqlCmd.Parameters.Add("@Bak2", SqlDbType.NVarChar, 50).Value = Bak2;

                sqlCmd.Parameters.Add("@Bak3", SqlDbType.Int).Value = Bak3;

                iID = objDataAccess.ExecuteScalar(sqlCmd);
                return iID;
            }
        }
Ejemplo n.º 28
0
        public int CopyAndUpdateFields(int SourceID, string TenKhuVuc, string GhiChu, int? SapXep, bool? HienThi,
            string Bak1, string Bak2, int? Bak3)
        {
            DataAccess objDataAccess = new DataAccess();
            using (SqlCommand sqlCmd = new SqlCommand())
            {
                int iID = 0;
                sqlCmd.CommandType = CommandType.StoredProcedure;
                sqlCmd.CommandText = "CopyAndUpdateFieldsKhuVuc";

                sqlCmd.Parameters.Add("@SourceID", SqlDbType.Int).Value = SourceID;
                sqlCmd.Parameters.Add("@TenKhuVuc", SqlDbType.NVarChar, 50).Value = TenKhuVuc;

                sqlCmd.Parameters.Add("@GhiChu", SqlDbType.NVarChar, 1000).Value = GhiChu;

                sqlCmd.Parameters.Add("@SapXep", SqlDbType.Int).Value = SapXep;

                sqlCmd.Parameters.Add("@HienThi", SqlDbType.Bit).Value = HienThi;

                sqlCmd.Parameters.Add("@Bak1", SqlDbType.NVarChar, 50).Value = Bak1;

                sqlCmd.Parameters.Add("@Bak2", SqlDbType.NVarChar, 50).Value = Bak2;

                sqlCmd.Parameters.Add("@Bak3", SqlDbType.Int).Value = Bak3;

                iID = objDataAccess.ExecuteScalar(sqlCmd);
                return iID;
            }
        }
Ejemplo n.º 29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Write("{\"employees\": [");
        string connectionstring =
            System.Configuration.ConfigurationManager.ConnectionStrings["HuberGoDaddy"].ConnectionString;
        DataAccess da = new DataAccess();
        System.Data.DataSet ds = da.getDataSet(connectionstring,
            "select employeeid, firstname, lastname from huber_employees");

        //if there are no employees returned
        if (ds.Tables.Count <= 0 || ds.Tables[0].Rows.Count <= 0)
        {
            Response.Write("{}");
        }
        else
        {
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                Response.Write("{\"employeeid\": \"" +
                    ds.Tables[0].Rows[i].ItemArray[0].ToString() +
                    "\",\"firstname\":" +
                    "\"" + ds.Tables[0].Rows[i].ItemArray[1].ToString() + "\"}");

                if (i<ds.Tables[0].Rows.Count-1)
                {
                    Response.Write(",");
                }

            }
        }

        Response.Write("]}");
    }
Ejemplo n.º 30
0
        protected void Unnamed_ServerClick(object sender, EventArgs e)
        {
            String top = ettop.Value;
            String year = etyear.Value;
            int igender = gender.SelectedIndex;

            String sgender = null;
            switch (igender)
            {
                case 0:
                    sgender = "both";
                    break;
                case 1:
                    sgender = "male";
                    break;
                case 2:
                    sgender = "female";
                    break;
            }

            DataAccess da = new DataAccess();
            resulttop = da.SelectTop(year, top, sgender);
            topranking = new List<List<Name>>();
            topranking.Add(da.SelectTop(year, "10", sgender));
            topranking.Add(da.SelectTop(year, "50", sgender));
            topranking.Add(da.SelectTop(year, "100", sgender));
            topranking.Add(da.SelectTop(year, "250", sgender));
        }
Ejemplo n.º 31
0
        public DataTable getList()
        {
            string sql = "select * from std_parent";

            return(DataAccess.ExecuteSQLQuery(sql));
        }
Ejemplo n.º 32
0
        public ICollection <ErrorHandler> BulkInsert(string argExcelPath, string argQuery, string strTableName, string argFileExt, string argUserName, string argClientCode)
        {
            DataTable           dtExcel        = null;
            VendorGroup         ObjVendorGroup = null;
            string              xConnStr       = "";
            string              strSheetName   = "";
            DataSet             dsExcel        = new DataSet();
            DataTable           dtTableSchema  = new DataTable();
            OleDbConnection     objXConn       = null;
            OleDbDataAdapter    objDataAdapter = new OleDbDataAdapter();
            List <ErrorHandler> lstErr         = new List <ErrorHandler>();

            if (argFileExt.ToString() == ".xls")
            {
                xConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;" +
                           "Data Source=" + argExcelPath.Trim() + ";" +
                           "Extended Properties=Excel 8.0";
            }
            else
            {
                xConnStr = "Provider=Microsoft.ACE.OLEDB.12.0;" +
                           "Data Source=" + argExcelPath.Trim() + ";" +
                           "Extended Properties=Excel 12.0";
            }

            try
            {
                objXConn = new OleDbConnection(xConnStr);
                objXConn.Open();

                dtTableSchema = objXConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
                if (argFileExt.ToString() == ".xls")
                {
                    strSheetName = Convert.ToString(dtTableSchema.Rows[0]["TABLE_NAME"]);
                }
                else
                {
                    strSheetName = Convert.ToString(dtTableSchema.Rows[0]["TABLE_NAME"]);

                    if (strSheetName.IndexOf(@"_xlnm#_FilterDatabase") >= 0)
                    {
                        strSheetName = Convert.ToString(dtTableSchema.Rows[1]["TABLE_NAME"]);
                    }
                }
                argQuery = argQuery + " [" + strSheetName + "]";
                OleDbCommand objCommand = new OleDbCommand(argQuery, objXConn);
                objDataAdapter.SelectCommand = objCommand;
                objDataAdapter.Fill(dsExcel);
                dtExcel = dsExcel.Tables[0];

                /*****************************************/
                DataAccess da = new DataAccess();
                da.Open_Connection();
                da.BEGIN_TRANSACTION();

                try
                {
                    foreach (DataRow drExcel in dtExcel.Rows)
                    {
                        ObjVendorGroup = new VendorGroup();
                        ObjVendorGroup.VendGroupCode = Convert.ToString(drExcel["VendGroupCode"]).Trim();
                        ObjVendorGroup.VendGroupDesc = Convert.ToString(drExcel["VendGroupDesc"]).Trim();
                        ObjVendorGroup.CreatedBy     = Convert.ToString(argUserName);
                        ObjVendorGroup.ModifiedBy    = Convert.ToString(argUserName);
                        ObjVendorGroup.ClientCode    = Convert.ToString(argClientCode);
                        SaveVendorGroup(ObjVendorGroup, da, lstErr);

                        foreach (ErrorHandler objerr in lstErr)
                        {
                            if (objerr.Type == "E")
                            {
                                da.ROLLBACK_TRANSACTION();
                                break;
                            }
                        }
                    }
                    da.COMMIT_TRANSACTION();
                }
                catch (Exception ex)
                {
                    if (da != null)
                    {
                        da.ROLLBACK_TRANSACTION();
                    }
                    objErrorHandler.Type       = ErrorConstant.strAboartType;
                    objErrorHandler.MsgId      = 0;
                    objErrorHandler.Module     = ErrorConstant.strInsertModule;
                    objErrorHandler.ModulePart = ErrorConstant.strMasterModule;
                    objErrorHandler.Message    = ex.Message.ToString();
                    objErrorHandler.RowNo      = 0;
                    objErrorHandler.FieldName  = "";
                    objErrorHandler.LogCode    = "";
                    lstErr.Add(objErrorHandler);
                }
                finally
                {
                    if (da != null)
                    {
                        da.Close_Connection();
                        da = null;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objXConn.Close();
            }
            return(lstErr);
        }
Ejemplo n.º 33
0
 public userController()
 {
     this._objAuthtication = new DataAccess();
 }
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            string currentPassword;
            string newPassword;
            string newPasswordConfirm;

            if (string.Equals(currentItem.Username, Program.username))
            {
                // Check current password
                currentPassword = txtPassword.Text;
                if (currentPassword == "")
                {
                    //lblMessPassword.Text = "Nhập mật khẩu hiện tại";
                    MessageBox.Show("Nhập mật khẩu hiện tại",
                                    "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtPassword.Focus();
                    return;
                }
                else
                {
                    DataAccess da       = new DataAccess();
                    Nhanvien   employee = da.getNhanvienbyUserName(currentItem.Username);
                    if (!string.Equals(currentPassword, employee.Password))
                    {
                        //lblMessPassword.Text = "Mật khẩu không đúng!";
                        MessageBox.Show("Mật khẩu không đúng!",
                                        "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        txtPassword.Focus();
                        txtPassword.SelectAll();
                        txtNewPassword.Text        = "";
                        txtNewPasswordConfirm.Text = "";
                        return;
                    }
                }
            }

            // Check new password
            newPassword        = txtNewPassword.Text;
            newPasswordConfirm = txtNewPasswordConfirm.Text;
            if (newPassword == "")
            {
                //lblMessPassword.Text = "Nhập mật khẩu hiện tại";
                MessageBox.Show("Vui lòng nhập Mật khẩu mới",
                                "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtNewPassword.Focus();
                return;
            }

            if (newPasswordConfirm == "")
            {
                //lblMessPassword.Text = "Nhập mật khẩu hiện tại";
                MessageBox.Show("Vui lòng nhập Xác nhận lại Mật khẩu mới",
                                "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtNewPasswordConfirm.Focus();
                return;
            }

            if (String.Equals(newPassword, newPasswordConfirm))
            {
                DataAccess da       = new DataAccess();
                Nhanvien   employee = da.getNhanvienbyUserName(currentItem.Username);
                employee.Password = newPassword;
                //employee.PasswordHint = txtPasswordHint.Text;
                if (da.updateNhanvien(employee))
                {
                    MessageBox.Show("Thay đổi mật khẩu thành công",
                                    "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                txtPassword.Text           = "";
                txtNewPassword.Text        = "";
                txtNewPasswordConfirm.Text = "";
                txtPasswordHint.Text       = "";
            }
            else
            {
                MessageBox.Show("Mật khẩu mới và Mật khẩu xác nhận phải giống nhau!",
                                "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //lblMessPasswordRetype.Text = "Mật khẩu mới và Mật khẩu xác nhận phải giống nhau!";
                txtNewPasswordConfirm.Text = "";
                txtNewPassword.Focus();
                txtNewPassword.SelectAll();
            }
        }
Ejemplo n.º 35
0
        public bool blnIsVendorGroupExists(string argVendGroupCode, string argClientCode, DataAccess da)
        {
            bool    IsVendorGroupExists = false;
            DataSet ds = new DataSet();

            ds = GetVendorGroup(argVendGroupCode, argClientCode, da);

            if (ds.Tables[0].Rows.Count > 0)
            {
                IsVendorGroupExists = true;
            }
            else
            {
                IsVendorGroupExists = false;
            }
            return(IsVendorGroupExists);
        }
Ejemplo n.º 36
0
 public Meta_reductionruledetailview(DataAccess Conn, MetaDataDispatcher Dispatcher)
     :
     base(Conn, Dispatcher, "reductionruledetailview")
 {
     ListingTypes.Add("default");
 }
Ejemplo n.º 37
0
        public ICollection <ErrorHandler> SaveVendorGroup(VendorGroup argVendorGroup)
        {
            List <ErrorHandler> lstErr = new List <ErrorHandler>();
            DataAccess          da     = new DataAccess();

            try
            {
                if (blnIsVendorGroupExists(argVendorGroup.VendGroupCode, argVendorGroup.ClientCode) == false)
                {
                    da.Open_Connection();
                    da.BEGIN_TRANSACTION();
                    InsertVendorGroup(argVendorGroup, da, lstErr);
                    foreach (ErrorHandler objerr in lstErr)
                    {
                        if (objerr.Type == "E")
                        {
                            da.ROLLBACK_TRANSACTION();
                            return(lstErr);
                        }
                    }
                    da.COMMIT_TRANSACTION();
                }
                else
                {
                    da.Open_Connection();
                    da.BEGIN_TRANSACTION();
                    UpdateVendorGroup(argVendorGroup, da, lstErr);
                    foreach (ErrorHandler objerr in lstErr)
                    {
                        if (objerr.Type == "E")
                        {
                            da.ROLLBACK_TRANSACTION();
                            return(lstErr);
                        }
                    }
                    da.COMMIT_TRANSACTION();
                }
            }
            catch (Exception ex)
            {
                if (da != null)
                {
                    da.ROLLBACK_TRANSACTION();
                }
                objErrorHandler.Type       = ErrorConstant.strAboartType;
                objErrorHandler.MsgId      = 0;
                objErrorHandler.Module     = ErrorConstant.strInsertModule;
                objErrorHandler.ModulePart = ErrorConstant.strMasterModule;
                objErrorHandler.Message    = ex.Message.ToString();
                objErrorHandler.RowNo      = 0;
                objErrorHandler.FieldName  = "";
                objErrorHandler.LogCode    = "";
                lstErr.Add(objErrorHandler);
            }
            finally
            {
                if (da != null)
                {
                    da.Close_Connection();
                    da = null;
                }
            }
            return(lstErr);
        }
Ejemplo n.º 38
0
 public Meta_accountvar(DataAccess Conn, MetaDataDispatcher Dispatcher) :
     base(Conn, Dispatcher, "accountvar")
 {
     EditTypes.Add("default");
     ListingTypes.Add("default");
 }
Ejemplo n.º 39
0
        public void contactDetailsSetter(int id)
        {
            contactDetails.Visibility = Visibility.Visible;
            newContact.Visibility     = Visibility.Hidden;
            DataAccess       da  = new DataAccess();
            ContactViewModel cvm = da.contactDetailsList(id);

            if (!cvm.image.Equals(""))
            {
                try
                {
                    ImageBrush brush = new ImageBrush(new BitmapImage(new Uri(cvm.image, UriKind.Absolute)));
                    image.Background = brush;
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message);
                }
            }
            else
            {
                ImageBrush brush = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/PhoneBook;component/Image/Icon/uid.jpg", UriKind.Absolute)));
                image.Background = brush;
            }
            lblContactName.Content = cvm.name;
            Number1.Text           = cvm.num1;
            if (cvm.num2.Equals(""))
            {
                Number2.Visibility = Visibility.Collapsed;
            }
            else
            {
                Number2.Text       = cvm.num2;
                Number2.Visibility = Visibility.Visible;
            }
            if (cvm.num3.Equals(""))
            {
                Number3.Visibility = Visibility.Collapsed;
            }
            else
            {
                Number3.Text       = cvm.num3;
                Number3.Visibility = Visibility.Visible;
            }
            if (cvm.num4.Equals(""))
            {
                Number4.Visibility = Visibility.Collapsed;
            }
            else
            {
                Number4.Text       = cvm.num4;
                Number4.Visibility = Visibility.Visible;
            }
            if (cvm.num5.Equals(""))
            {
                Number5.Visibility = Visibility.Collapsed;
            }
            else
            {
                Number5.Text       = cvm.num5;
                Number5.Visibility = Visibility.Visible;
            }
            if (cvm.num6.Equals(""))
            {
                Number6.Visibility = Visibility.Collapsed;
            }
            else
            {
                Number6.Text       = cvm.num6;
                Number6.Visibility = Visibility.Visible;
            }
            if (cvm.email.Equals(""))
            {
                email.Visibility    = Visibility.Collapsed;
                lblemail.Visibility = Visibility.Collapsed;
            }
            else
            {
                email.Text          = cvm.email;
                email.Visibility    = Visibility.Visible;
                lblemail.Visibility = Visibility.Visible;
            }
            if (cvm.street.Equals(""))
            {
                street.Visibility    = Visibility.Collapsed;
                lblstreet.Visibility = Visibility.Collapsed;
            }
            else
            {
                street.Text          = cvm.street;
                street.Visibility    = Visibility.Visible;
                lblstreet.Visibility = Visibility.Visible;
            }
            if (cvm.city.Equals(""))
            {
                city.Visibility    = Visibility.Collapsed;
                lblcity.Visibility = Visibility.Collapsed;
            }
            else
            {
                city.Text          = cvm.city;
                city.Visibility    = Visibility.Visible;
                lblcity.Visibility = Visibility.Visible;
            }
            if (cvm.zip.Equals(""))
            {
                zip.Visibility    = Visibility.Collapsed;
                lblzip.Visibility = Visibility.Collapsed;
            }
            else
            {
                zip.Text          = cvm.zip;
                zip.Visibility    = Visibility.Visible;
                lblzip.Visibility = Visibility.Visible;
            }
            if (cvm.state.Equals(""))
            {
                state.Visibility    = Visibility.Collapsed;
                lblstate.Visibility = Visibility.Collapsed;
            }
            else
            {
                state.Text          = cvm.state;
                state.Visibility    = Visibility.Visible;
                lblstate.Visibility = Visibility.Visible;
            }
            if (cvm.country.Equals(""))
            {
                country.Visibility    = Visibility.Collapsed;
                lblcountry.Visibility = Visibility.Collapsed;
            }
            else
            {
                country.Text          = cvm.country;
                country.Visibility    = Visibility.Visible;
                lblcountry.Visibility = Visibility.Visible;
            }
            if (cvm.group.Equals(""))
            {
                group.Visibility    = Visibility.Collapsed;
                lblgroup.Visibility = Visibility.Collapsed;
            }
            else
            {
                group.Text          = cvm.group;
                group.Visibility    = Visibility.Visible;
                lblgroup.Visibility = Visibility.Visible;
            }
            if (cvm.about.Equals("null"))
            {
                about.Visibility    = Visibility.Collapsed;
                lblabout.Visibility = Visibility.Collapsed;
            }
            else
            {
                about.Document.Blocks.Clear();
                about.Document.Blocks.Add(new Paragraph(new Run(cvm.about)));
                about.Visibility    = Visibility.Visible;
                lblabout.Visibility = Visibility.Visible;
            }
        }
Ejemplo n.º 40
0
 static TaskController()
 {
     secret     = "xxOvertimexx";
     dataAccess = new DataAccess();
 }
Ejemplo n.º 41
0
 public IdentityUserDataGridHandler(Pages.ModelPage modelPage, DataAccess <TContract> dataAccess) : base(modelPage, dataAccess)
 {
 }
Ejemplo n.º 42
0
 public override IBase <VideoComment> GetDal()
 {
     return(DataAccess.CreateVideoComment());
 }
Ejemplo n.º 43
0
        protected void brnAdd_Click(object sender, EventArgs e)
        {
            if (Session["SysPasswordOk"] == null)
            {
                lblmessages.Text =
                    "Prima di procedere alla configurazione, inserire la Password di abilitazione alla configurazione.";
                return;
            }
            string     error = "";
            DataAccess sys   = GetVars.GetSystemDataAccess(this, out error);

            if (sys == null)
            {
                lblmessages.Text = "Servizio Web non installato correttamente.";
                if (error != null)
                {
                    lblmessages.Text += error;
                }
                return;
            }

            string          dip    = txtDip.Text;
            string          codice = txtCodice.Text;
            string          ip     = txtIP.Text;
            string          db     = txtDB.Text;
            string          user   = txtUser.Text;
            string          pwd    = txtPWD.Text;
            Easy_DataAccess Conn   = new Easy_DataAccess(
                "mydsn", ip, db, user, pwd, user, pwd, DateTime.Now.Year, DateTime.Now);

            if (Conn == null)
            {
                lblmessages.Text = "Non è stato possibile collegarsi al server.";
                return;
            }
            Conn.Open();
            if (Conn.OpenError)
            {
                lblmessages.Text = "Non è stato possibile collegarsi al server.";
                return;
            }
            Conn.Close();
            DataSet DS = new Dipartimenti();

            if (sys.RUN_SELECT_COUNT("CodiciDipartimenti",
                                     "(CodiceDipartimento=" +
                                     QueryCreator.quotedstrvalue(codice, true) + ")", true) > 0)
            {
                lblmessages.Text = "Codice dipartimento già esistente.";
                return;
            }
            DataTable T = DS.Tables[0];
            DataRow   R = T.NewRow();

            R["CodiceDipartimento"] = codice;
            R["dipartimento"]       = dip;
            R["IPserver"]           = GetVars.CryptPassword(ip);
            R["NomeDB"]             = GetVars.CryptPassword(db);
            R["UserDB"]             = GetVars.CryptPassword(user);
            R["PassDB"]             = GetVars.CryptPassword(pwd);
            T.Rows.Add(R);
            PostData CP = new PostData();

            CP.InitClass(DS, sys);

            ProcedureMessageCollection MCOLL = CP.DO_POST_SERVICE();

            if (!MCOLL.CanIgnore)
            {
                lblmessages.Text = "Delle regole di sicurezza hanno impedito l'update del db di sistema!!";
                return;
            }
            else
            {
                if (MCOLL.Count > 0)
                {
                    CP.DO_POST_SERVICE();
                }
            }


            lblmessages.Text = "DB DI SISTEMA Aggiornato correttamente.";
        }
Ejemplo n.º 44
0
 protected void Page_Load(object sender, EventArgs e)
 {
     da = new DataAccess("NA");
 }
Ejemplo n.º 45
0
 public Meta_colname(DataAccess Conn, MetaDataDispatcher Dispatcher) :
     base(Conn, Dispatcher, "colname")
 {
     EditTypes.Add("default");
     Name = "colname";
 }
Ejemplo n.º 46
0
        private void ReloadList()
        {
            DataAccess da = new DataAccess();

            dgList.DataContext = da.GetUnits();
        }
Ejemplo n.º 47
0
 public Meta_creditproceedsview(DataAccess Conn, MetaDataDispatcher Dispatcher) :
     base(Conn, Dispatcher, "creditproceedsview")
 {
     Name = "Crediti e cassa assegnati ";
     ListingTypes.Add("lista");
 }