protected void BindElecricity()
    {
        string Eyear = null;

        if (DdlElecricity.SelectedValue != "-1")
        {
            Eyear = DdlElecricity.SelectedValue;
        }
        else
        {
            Eyear = null;
        }

        DataTable DT = TMSElectricity.GetElectricitySEARCH(null, null, null, null, Eyear, null, null, null, null, null).Tables[0];

        if (DT.Rows.Count > 0)
        {
            HiddPaud.Value      = DT.Rows[0]["EL_PaidStatus"].ToString();
            sortsection.Visible = true;
        }
        else
        {
            sortsection.Visible = false;
        }

        GrdElecricity.DataSource = DT;
        GrdElecricity.DataBind();
    }
Example #2
0
    public static TMSElectricity Get(System.Int64 elEbillID)
    {
        DataSet        ds;
        Database       db;
        string         sqlCommand;
        DbCommand      dbCommand;
        TMSElectricity instance;


        instance = new TMSElectricity();

        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSElectricity_SELECT";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, elEbillID);

        // Get results.
        ds = db.ExecuteDataSet(dbCommand);
        // Verification.
        if (ds == null || ds.Tables[0].Rows.Count == 0)
        {
            throw new ApplicationException("Could not get TMSElectricity ID:" + elEbillID.ToString() + " from Database.");
        }
        // Return results.
        ds.Tables[0].TableName = TABLE_NAME;

        instance.MapFrom(ds.Tables[0].Rows[0]);
        return(instance);
    }
    protected void BindEYear()
    {
        DataTable Dt = TMSElectricity.GetDistinctYear("Elecricity").Tables[0];

        DdlElecricity.DataSource     = Dt;
        DdlElecricity.DataValueField = "DistYear";
        DdlElecricity.DataTextField  = "DistYear";
        DdlElecricity.DataBind();
        DdlElecricity.Items.Insert(0, new ListItem("Select", "-1"));
    }
    protected void BindWYear()
    {
        DataTable Dt = TMSElectricity.GetDistinctYear("sdf").Tables[0];

        ddlwater.DataSource     = Dt;
        ddlwater.DataValueField = "DistYear";
        ddlwater.DataTextField  = "DistYear";
        ddlwater.DataBind();
        ddlwater.Items.Insert(0, new ListItem("Select", "-1"));
    }
    protected void ElecricityEdit_Click(object sender, EventArgs e)
    {
        dvMsg.Visible          = false;
        lbladd.Text            = "Edit";
        SElecricity.Visible    = false;
        SWater.Visible         = false;
        Addelecricity.Visible  = true;
        AddwaterSupply.Visible = false;
        aElectricSupply.Attributes.Add("class", "active");
        awaterSupply.Attributes.Add("class", "");
        RequiredFieldValidator4.Visible = false;
        LinkButton lnkedite = (LinkButton)sender;

        GridViewRow Grd = (GridViewRow)lnkedite.NamingContainer;

        Label lblEl_EbillID = Grd.FindControl("lblEl_EbillID") as Label;

        //lblHead.Text = "Edit Electicity";
        btnSubmit.Text   = "Update";
        liUnpaid.Visible = true;
        Int64 EbillID = Convert.ToInt64(lblEl_EbillID.Text);

        hiddElectricID.Value = lblEl_EbillID.Text;
        TMSElectricity objelectricity = TMSElectricity.Get(EbillID);

        if (objelectricity != null)
        {
            txtBillAmount.Text = objelectricity.ELBillAmount.ToString();
            txtLateFees.Text   = objelectricity.ELLateFees.ToString();
            txtBillNumber.Text = objelectricity.ELBIllno;
            if (objelectricity.ElLastDate != null)
            {
                txtDate1.SelectedDate = objelectricity.ElLastDate;
            }
            ddlMonth.SelectedValue      = objelectricity.ELMonth;
            ddlyear.SelectedValue       = objelectricity.ElYear;
            ddlpaidstatus.SelectedValue = objelectricity.ELPaidStatus;
            HidduploadeFile.Value       = "";
            if (objelectricity.ELBillFile != null)
            {
                Hylblfilename.Visible           = true;
                Hylblfilename.NavigateUrl       = objelectricity.ELBillFile;
                RequiredFieldValidator4.Visible = false;
                HidduploadeFile.Value           = objelectricity.ELBillFile;
            }
            else
            {
                Hylblfilename.Visible = false;
            }
            HiddPaud.Value = objelectricity.ELPaidStatus;
        }
    }
Example #6
0
    public static TMSElectricity[] Search(System.Int64?elEbillID, System.Double?elBillAmount, System.Double?elLateFees, System.String elMonth, System.String elYear, System.DateTime?elLastDate, System.DateTime?elBillPaidDate, System.Double?elTotalAmount, System.String elPaidStatus, System.String elbIllno, System.String elBillFile, System.String elExtra1, System.String elExtra2, System.DateTime?elDate, System.Int32?elStatus)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSElectricity_SEARCH";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, elEbillID, elBillAmount, elLateFees, elMonth, elYear, elLastDate, elBillPaidDate, elTotalAmount, elPaidStatus, elbIllno, elBillFile, elExtra1, elExtra2, elDate, elStatus);

        ds = db.ExecuteDataSet(dbCommand);
        ds.Tables[0].TableName = TABLE_NAME;
        return(TMSElectricity.MapFrom(ds));
    }
Example #7
0
    public static TMSElectricity[] MapFrom(DataSet ds)
    {
        List <TMSElectricity> objects;


        // Initialise Collection.
        objects = new List <TMSElectricity>();

        // Validation.
        if (ds == null)
        {
            throw new ApplicationException("Cannot map to dataset null.");
        }
        else if (ds.Tables[TABLE_NAME].Rows.Count == 0)
        {
            return(objects.ToArray());
        }

        if (ds.Tables[TABLE_NAME] == null)
        {
            throw new ApplicationException("Cannot find table [dbo].[TMS_Electricity] in DataSet.");
        }

        if (ds.Tables[TABLE_NAME].Rows.Count < 1)
        {
            throw new ApplicationException("Table [dbo].[TMS_Electricity] is empty.");
        }

        // Map DataSet to Instance.
        foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows)
        {
            TMSElectricity instance = new TMSElectricity();
            instance.MapFrom(dr);
            objects.Add(instance);
        }

        // Return collection.
        return(objects.ToArray());
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        try
        {
            if (btnSubmit.Text == "Update")
            {
                Int64 EbillID = Convert.ToInt64(hiddElectricID.Value);


                DataTable Dt = TMSElectricity.BindAlredyexistElectricity(EbillID, null, null, ddlMonth.SelectedValue, ddlyear.SelectedValue, null, null, null, null, null).Tables[0];
                if (Dt.Rows.Count > 0)
                {
                    dvMsg.Visible   = true;
                    lblMessage.Text = "record already exists for entered month and year";
                    dvMsg.Attributes.Add("class", "error_msg");
                    return;
                }

                else
                {
                    TMSElectricity objelectricity = TMSElectricity.Get(EbillID);
                    if (objelectricity != null)
                    {
                        objelectricity.ELBillAmount = Convert.ToDouble(txtBillAmount.Text);
                        objelectricity.ELLateFees   = Convert.ToDouble(txtLateFees.Text);
                        objelectricity.ELBIllno     = txtBillNumber.Text;
                        objelectricity.ElLastDate   = txtDate1.SelectedDate;
                        objelectricity.ELMonth      = ddlMonth.SelectedValue;
                        objelectricity.ElYear       = ddlyear.SelectedValue;

                        if (HidduploadeFile.Value == "")
                        {
                            if (UploadFile.FileName != "")
                            {
                                string strFatherFileNameWithPath2 = UploadFile.FileName;
                                string strFatherExtensionName2    = System.IO.Path.GetExtension(strFatherFileNameWithPath2).ToLower();
                                string strFatherFileName2         = System.IO.Path.GetFileName(strFatherFileNameWithPath2).Replace(" ", "_");
                                if (strFatherExtensionName2.Equals(".jpg") || strFatherExtensionName2.Equals(".gif") || strFatherExtensionName2.Equals(".png") || strFatherExtensionName2.Equals(".jpeg") || strFatherExtensionName2.Equals(".bmp"))
                                {
                                    string[] Name2           = strFatherFileName2.Split('.');
                                    string   Fname2          = Name2[0];
                                    string   ReplacFileName2 = Fname2 + "_" + DateTime.Now.ToString("yyyyMMddhhmmss") + strFatherExtensionName2;
                                    UploadFile.PostedFile.SaveAs(Server.MapPath(@"..\\Files\\" + ReplacFileName2));
                                    objelectricity.ELBillFile = "../Files/" + ReplacFileName2;
                                    // string ImgPath = "../Files/" + ReplacFileName2;
                                }
                                else
                                {
                                    dvMsg.Visible   = true;
                                    lblMessage.Text = "Please Upload .jpg,.gif,.png,.jpeg,.bmp File Only";
                                    dvMsg.Attributes.Add("class", "error_msg");
                                    return;
                                }
                            }
                        }
                        objelectricity.ELPaidStatus = ddlpaidstatus.SelectedValue;
                        if (HiddPaud.Value == "Paid")
                        {
                            if (ddlpaidstatus.SelectedValue == "Unpaid")
                            {
                                //objelectricity.ElBillPaidDate = "";
                            }
                        }
                        else
                        {
                            if (ddlpaidstatus.SelectedValue == "Paid")
                            {
                                if (Convert.ToDateTime(objelectricity.ElLastDate) < DateTime.Now)
                                {
                                    DateTime myDate1    = DateTime.Now;
                                    DateTime myDate2    = Convert.ToDateTime(objelectricity.ElLastDate);
                                    TimeSpan difference = myDate1.Subtract(myDate2);

                                    Double   totalDays = Convert.ToDouble(difference.TotalDays);
                                    string   ss        = totalDays.ToString();
                                    string[] one       = ss.Split('.');

                                    if (totalDays > 0)
                                    {
                                        Double SS = (Convert.ToDouble(objelectricity.ELLateFees) * Convert.ToDouble(one[0]));

                                        objelectricity.ELTotalAmount = Convert.ToDouble(Convert.ToDouble(objelectricity.ELBillAmount) + SS);

                                        objelectricity.ElBillPaidDate = DateTime.Now;
                                    }
                                }

                                else
                                {
                                    objelectricity.ELTotalAmount  = Convert.ToDouble(objelectricity.ELBillAmount);
                                    objelectricity.ElBillPaidDate = DateTime.Now;
                                }
                            }
                        }
                        objelectricity.ELDate   = DateTime.Now;
                        objelectricity.ELStatus = 1;
                        objelectricity.Update();

                        SElecricity.Visible    = true;
                        SWater.Visible         = false;
                        Addelecricity.Visible  = false;
                        AddwaterSupply.Visible = false;
                        BindEYear();
                        BindElecricity();
                        aElectricSupply.Attributes.Add("class", "active");
                        awaterSupply.Attributes.Add("class", "");
                        dvMsg.Visible   = true;
                        lblMessage.Text = "Electricity Bill Updated Successfully";
                        dvMsg.Attributes.Add("class", "warring_msg");
                        //  Response.Redirect("ManageElectricity.aspx?msg=Electricity Updated Successfully");
                    }
                }
            }


            else
            {
                TMSElectricity objelectricity = new TMSElectricity();


                objelectricity.ELMonth = ddlMonth.SelectedValue;
                objelectricity.ElYear  = ddlyear.SelectedValue;

                DataTable DtElectricity = TMSElectricity.GetSearch(objelectricity).Tables[0];


                if (DtElectricity.Rows.Count > 0)
                {
                    dvMsg.Visible   = true;
                    lblMessage.Text = "record already exist For entered month And year";
                    dvMsg.Attributes.Add("class", "error_msg");
                    return;
                }

                else
                {
                    objelectricity.ElLastDate   = txtDate1.SelectedDate;
                    objelectricity.ELBillAmount = Convert.ToDouble(txtBillAmount.Text);
                    objelectricity.ELLateFees   = Convert.ToDouble(txtLateFees.Text);
                    objelectricity.ELBIllno     = txtBillNumber.Text;

                    objelectricity.ELPaidStatus = "Unpaid";
                    objelectricity.ELDate       = DateTime.Now;
                    objelectricity.ELStatus     = 1;

                    if (UploadFile.FileName != "")
                    {
                        string strFatherFileNameWithPath2 = UploadFile.FileName;
                        string strFatherExtensionName2    = System.IO.Path.GetExtension(strFatherFileNameWithPath2).ToLower();
                        string strFatherFileName2         = System.IO.Path.GetFileName(strFatherFileNameWithPath2).Replace(" ", "_");
                        if (strFatherExtensionName2.Equals(".jpg") || strFatherExtensionName2.Equals(".gif") || strFatherExtensionName2.Equals(".png") || strFatherExtensionName2.Equals(".jpeg") || strFatherExtensionName2.Equals(".bmp"))
                        {
                            string[] Name2           = strFatherFileName2.Split('.');
                            string   Fname2          = Name2[0];
                            string   ReplacFileName2 = Fname2 + "_" + DateTime.Now.ToString("yyyyMMddhhmmss") + strFatherExtensionName2;
                            UploadFile.PostedFile.SaveAs(Server.MapPath(@"..\\Files\\" + ReplacFileName2));
                            objelectricity.ELBillFile = "../Files/" + ReplacFileName2;
                            //string ImgPath = "../Files/" + ReplacFileName2;
                        }
                        else
                        {
                            dvMsg.Visible   = true;
                            lblMessage.Text = "Please Upload .jpg,.gif,.png,.jpeg,.bmp File Only";
                            dvMsg.Attributes.Add("class", "error_msg");
                            return;
                        }
                    }



                    objelectricity.Insert();
                    SElecricity.Visible    = true;
                    SWater.Visible         = false;
                    Addelecricity.Visible  = false;
                    AddwaterSupply.Visible = false;
                    BindEYear();
                    BindElecricity();
                    aElectricSupply.Attributes.Add("class", "active");
                    awaterSupply.Attributes.Add("class", "");
                    dvMsg.Visible   = true;
                    lblMessage.Text = "Electricity Bill Added Successfully";
                    dvMsg.Attributes.Add("class", "warring_msg");
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
Example #9
0
 public static TMSElectricity[] Search(TMSElectricity searchObject)
 {
     return(Search(searchObject.ElEbillID, searchObject.ELBillAmount, searchObject.ELLateFees, searchObject.ELMonth, searchObject.ElYear, searchObject.ElLastDate, searchObject.ElBillPaidDate, searchObject.ELTotalAmount, searchObject.ELPaidStatus, searchObject.ELBIllno, searchObject.ELBillFile, searchObject.ELExtra1, searchObject.ELExtra2, searchObject.ELDate, searchObject.ELStatus));
 }
Example #10
0
 public static void Update(TMSElectricity tMSElectricity, DbTransaction transaction)
 {
     tMSElectricity.Update(transaction);
 }
    public static TMSElectricity[] MapFrom(DataSet ds)
    {
        List<TMSElectricity> objects;

        // Initialise Collection.
        objects = new List<TMSElectricity>();

        // Validation.
        if (ds == null)
        throw new ApplicationException("Cannot map to dataset null.");
        else if (ds.Tables[TABLE_NAME].Rows.Count == 0)
        return objects.ToArray();

        if (ds.Tables[TABLE_NAME] == null)
        throw new ApplicationException("Cannot find table [dbo].[TMS_Electricity] in DataSet.");

        if (ds.Tables[TABLE_NAME].Rows.Count < 1)
        throw new ApplicationException("Table [dbo].[TMS_Electricity] is empty.");

        // Map DataSet to Instance.
        foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows)
        {
            TMSElectricity instance = new TMSElectricity();
            instance.MapFrom(dr);
            objects.Add(instance);
        }

        // Return collection.
        return objects.ToArray();
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        try
        {

            if (btnSubmit.Text == "Update")
            {

                Int64 EbillID = Convert.ToInt64(hiddElectricID.Value);

                DataTable Dt = TMSElectricity.BindAlredyexistElectricity(EbillID, null, null, ddlMonth.SelectedValue, ddlyear.SelectedValue, null, null, null, null, null).Tables[0];
                if (Dt.Rows.Count > 0)
                {
                    dvMsg.Visible = true;
                    lblMessage.Text = "record already exists for entered month and year";
                    dvMsg.Attributes.Add("class", "error_msg");
                    return;
                }

                else
                {

                    TMSElectricity objelectricity = TMSElectricity.Get(EbillID);
                    if (objelectricity != null)
                    {
                        objelectricity.ELBillAmount = Convert.ToDouble(txtBillAmount.Text);
                        objelectricity.ELLateFees = Convert.ToDouble(txtLateFees.Text);
                        objelectricity.ELBIllno = txtBillNumber.Text;
                        objelectricity.ElLastDate = txtDate1.SelectedDate;
                        objelectricity.ELMonth = ddlMonth.SelectedValue;
                        objelectricity.ElYear = ddlyear.SelectedValue;

                        if (HidduploadeFile.Value == "")
                        {
                            if (UploadFile.FileName != "")
                            {

                                string strFatherFileNameWithPath2 = UploadFile.FileName;
                                string strFatherExtensionName2 = System.IO.Path.GetExtension(strFatherFileNameWithPath2).ToLower();
                                string strFatherFileName2 = System.IO.Path.GetFileName(strFatherFileNameWithPath2).Replace(" ", "_");
                                if (strFatherExtensionName2.Equals(".jpg") || strFatherExtensionName2.Equals(".gif") || strFatherExtensionName2.Equals(".png") || strFatherExtensionName2.Equals(".jpeg") || strFatherExtensionName2.Equals(".bmp"))
                                {

                                    string[] Name2 = strFatherFileName2.Split('.');
                                    string Fname2 = Name2[0];
                                    string ReplacFileName2 = Fname2 + "_" + DateTime.Now.ToString("yyyyMMddhhmmss") + strFatherExtensionName2;
                                    UploadFile.PostedFile.SaveAs(Server.MapPath(@"..\\Files\\" + ReplacFileName2));
                                    objelectricity.ELBillFile = "../Files/" + ReplacFileName2;
                                    // string ImgPath = "../Files/" + ReplacFileName2;

                                }
                                else
                                {
                                    dvMsg.Visible = true;
                                    lblMessage.Text = "Please Upload .jpg,.gif,.png,.jpeg,.bmp File Only";
                                    dvMsg.Attributes.Add("class", "error_msg");
                                    return;
                                }

                            }

                        }
                        objelectricity.ELPaidStatus = ddlpaidstatus.SelectedValue;
                        if (HiddPaud.Value == "Paid")
                        {
                            if (ddlpaidstatus.SelectedValue == "Unpaid")
                            {
                                //objelectricity.ElBillPaidDate = "";
                            }

                        }
                        else
                        {
                            if (ddlpaidstatus.SelectedValue == "Paid")
                            {

                                if (Convert.ToDateTime(objelectricity.ElLastDate) < DateTime.Now)
                                {
                                    DateTime myDate1 = DateTime.Now;
                                    DateTime myDate2 = Convert.ToDateTime(objelectricity.ElLastDate);
                                    TimeSpan difference = myDate1.Subtract(myDate2);

                                    Double totalDays = Convert.ToDouble(difference.TotalDays);
                                    string ss = totalDays.ToString();
                                    string[] one = ss.Split('.');

                                    if (totalDays > 0)
                                    {
                                        Double SS = (Convert.ToDouble(objelectricity.ELLateFees) * Convert.ToDouble(one[0]));

                                        objelectricity.ELTotalAmount = Convert.ToDouble(Convert.ToDouble(objelectricity.ELBillAmount) + SS);

                                        objelectricity.ElBillPaidDate = DateTime.Now;

                                    }

                                }

                                else
                                {

                                    objelectricity.ELTotalAmount = Convert.ToDouble(objelectricity.ELBillAmount);
                                    objelectricity.ElBillPaidDate = DateTime.Now;
                                }

                            }
                        }
                        objelectricity.ELDate = DateTime.Now;
                        objelectricity.ELStatus = 1;
                        objelectricity.Update();

                        SElecricity.Visible = true;
                        SWater.Visible = false;
                        Addelecricity.Visible = false;
                        AddwaterSupply.Visible = false;
                        BindEYear();
                        BindElecricity();
                        aElectricSupply.Attributes.Add("class", "active");
                        awaterSupply.Attributes.Add("class", "");
                        dvMsg.Visible = true;
                        lblMessage.Text = "Electricity Bill Updated Successfully";
                        dvMsg.Attributes.Add("class", "warring_msg");
                        //  Response.Redirect("ManageElectricity.aspx?msg=Electricity Updated Successfully");

                    }

                }
            }

            else
            {

                TMSElectricity objelectricity = new TMSElectricity();

                objelectricity.ELMonth = ddlMonth.SelectedValue;
                objelectricity.ElYear = ddlyear.SelectedValue;

                DataTable DtElectricity = TMSElectricity.GetSearch(objelectricity).Tables[0];

                if (DtElectricity.Rows.Count > 0)
                {
                    dvMsg.Visible = true;
                    lblMessage.Text = "record already exist For entered month And year";
                    dvMsg.Attributes.Add("class", "error_msg");
                    return;
                }

                else
                {
                    objelectricity.ElLastDate = txtDate1.SelectedDate;
                    objelectricity.ELBillAmount = Convert.ToDouble(txtBillAmount.Text);
                    objelectricity.ELLateFees = Convert.ToDouble(txtLateFees.Text);
                    objelectricity.ELBIllno = txtBillNumber.Text;

                    objelectricity.ELPaidStatus = "Unpaid";
                    objelectricity.ELDate = DateTime.Now;
                    objelectricity.ELStatus = 1;

                    if (UploadFile.FileName != "")
                    {

                        string strFatherFileNameWithPath2 = UploadFile.FileName;
                        string strFatherExtensionName2 = System.IO.Path.GetExtension(strFatherFileNameWithPath2).ToLower();
                        string strFatherFileName2 = System.IO.Path.GetFileName(strFatherFileNameWithPath2).Replace(" ", "_");
                        if (strFatherExtensionName2.Equals(".jpg") || strFatherExtensionName2.Equals(".gif") || strFatherExtensionName2.Equals(".png") || strFatherExtensionName2.Equals(".jpeg") || strFatherExtensionName2.Equals(".bmp"))
                        {

                            string[] Name2 = strFatherFileName2.Split('.');
                            string Fname2 = Name2[0];
                            string ReplacFileName2 = Fname2 + "_" + DateTime.Now.ToString("yyyyMMddhhmmss") + strFatherExtensionName2;
                            UploadFile.PostedFile.SaveAs(Server.MapPath(@"..\\Files\\" + ReplacFileName2));
                            objelectricity.ELBillFile = "../Files/" + ReplacFileName2;
                            //string ImgPath = "../Files/" + ReplacFileName2;

                        }
                        else
                        {
                            dvMsg.Visible = true;
                            lblMessage.Text = "Please Upload .jpg,.gif,.png,.jpeg,.bmp File Only";
                            dvMsg.Attributes.Add("class", "error_msg");
                            return;
                        }

                    }

                    objelectricity.Insert();
                    SElecricity.Visible = true;
                    SWater.Visible = false;
                    Addelecricity.Visible = false;
                    AddwaterSupply.Visible = false;
                    BindEYear();
                    BindElecricity();
                    aElectricSupply.Attributes.Add("class", "active");
                    awaterSupply.Attributes.Add("class", "");
                    dvMsg.Visible = true;
                    lblMessage.Text = "Electricity Bill Added Successfully";
                    dvMsg.Attributes.Add("class", "warring_msg");

                }
            }

        }
        catch (Exception ex)
        {

        }
    }
Example #13
0
 public static DataSet GetSearch(TMSElectricity searchObject)
 {
     return GetSearch(searchObject.ElEbillID, searchObject.ELBillAmount, searchObject.ELLateFees, searchObject.ELMonth, searchObject.ElYear, searchObject.ElLastDate, searchObject.ElBillPaidDate, searchObject.ELTotalAmount, searchObject.ELPaidStatus, searchObject.ELBIllno, searchObject.ELBillFile, searchObject.ELExtra1, searchObject.ELExtra2, searchObject.ELDate, searchObject.ELStatus);
 }
 public static void Update(TMSElectricity tMSElectricity, DbTransaction transaction)
 {
     tMSElectricity.Update(transaction);
 }
 public static void Update(TMSElectricity tMSElectricity)
 {
     tMSElectricity.Update();
 }
Example #16
0
 public static void Update(TMSElectricity tMSElectricity)
 {
     tMSElectricity.Update();
 }
    public static TMSElectricity Get(System.Int64 elEbillID)
    {
        DataSet ds;
        Database db;
        string sqlCommand;
        DbCommand dbCommand;
        TMSElectricity instance;

        instance = new TMSElectricity();

        db = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSElectricity_SELECT";
        dbCommand = db.GetStoredProcCommand(sqlCommand, elEbillID);

        // Get results.
        ds = db.ExecuteDataSet(dbCommand);
        // Verification.
        if (ds == null || ds.Tables[0].Rows.Count == 0) throw new ApplicationException("Could not get TMSElectricity ID:" + elEbillID.ToString()+ " from Database.");
        // Return results.
        ds.Tables[0].TableName = TABLE_NAME;

        instance.MapFrom( ds.Tables[0].Rows[0] );
        return instance;
    }