Beispiel #1
0
        public ActionResult PropNuevo(AltaPropViewModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    properties objP = new properties();
                    objP.property_name    = model.Name;
                    objP.property_address = model.Address;
                    objdb.properties.Add(objP);
                    objdb.SaveChanges();
                }
                ModelState.Clear();

                return(RedirectToAction("Properties"));
            }
            catch {
                return(View());
            }



            /*var oProp = new properties();
             * oProp.id = model.Id;
             * oProp.property_name = model.Name;
             * oProp.property_name = model.Address;
             *
             * db.properties.Add(oProp);
             * db.SaveChanges();*/
        }
Beispiel #2
0
 public void AdminInsertUpdateChangeSizeAddStorey(properties P)
 {
     using (cmdd = new SqlCommand())
     {
         cmdd.CommandType = CommandType.StoredProcedure;
         cmdd.CommandText = "sp_AdminInsertUpdate_ModificationForm_ChangeofSize_AddStorey";
         cmdd.Connection  = getConnection.getconnection();
         cmdd.Parameters.AddWithValue("@inword", P.AdminInsertChangeSizeAddStorey_Inword);
         cmdd.Parameters.AddWithValue("@inword_modifyimpact", P.AdminInsertChangeSizeAddStorey_InwordModifyImpact);
         cmdd.Parameters.AddWithValue("@consumer_no", P.AdminInsertChangeSizeAddStorey_ConsumerNo);
         cmdd.Parameters.AddWithValue("@consumer_no_Consumer", P.AdminInsertChangeSizeAddStorey_ConsumernoConsumer);
         cmdd.Parameters.AddWithValue("@consumer_no_invoice", P.AdminInsertChangeSizeAddStorey_ConsumernoInvoice);
         cmdd.Parameters.AddWithValue("@modification_status", P.AdminInsertChangeSizeAddStorey_ModificationStatus);
         cmdd.Parameters.AddWithValue("@modification_status_modifyimpact", P.AdminInsertChangeSizeAddStorey_ModificationStatusModifyImpact);
         cmdd.Parameters.AddWithValue("@new_area", P.AdminInsertChangeSizeAddStorey_NewArea);
         cmdd.Parameters.AddWithValue("@AreaForConsumer", P.AdminInsertChangeSizeAddStorey_AreaForConsumer);
         cmdd.Parameters.AddWithValue("@new_storey", P.AdminInsertChangeSizeAddStorey_NewStorey);
         cmdd.Parameters.AddWithValue("@new_current_Charge", P.AdminInsertChangeSizeAddStorey_NewCurrentCharge);
         cmdd.Parameters.AddWithValue("@new_outstanding_Arrears", P.AdminInsertChangeSizeAddStorey_NewOutstandingArrears);
         cmdd.Parameters.AddWithValue("@createdby", P.AdminInsertChangeSizeAddStorey_Createdby);
         cmdd.Parameters.AddWithValue("@createdby_modifyimpact", P.AdminInsertChangeSizeAddStorey_CreatedbyModifyImpact);
         cmdd.Parameters.AddWithValue("@description", P.AdminInsertChangeSizeAddStorey_Description);
         cmdd.Parameters.AddWithValue("@description_modifyimpact", P.AdminInsertChangeSizeAddStorey_DescriptionModifyImpact);
         cmdd.Parameters.AddWithValue("@difference", P.AdminInsertChangeSizeAddStorey_Difference);
         cmdd.Parameters.AddWithValue("@impact", P.AdminInsertChangeSizeAddStorey_Impact);
         cmdd.Parameters.AddWithValue("@sq_ft", P.AdminInsertChangeSizeAddStorey_sqft);
         cmdd.Parameters.AddWithValue("@sq_yd", P.AdminInsertChangeSizeAddStorey_sqyd);
         cmdd.Parameters.AddWithValue("@sqft_sqyd", P.AdminInsertChangeSizeAddStorey_sqydft);
         cmdd.ExecuteNonQuery();
     }
 }
Beispiel #3
0
 public void AdminInsertUpdateChangeCategory(properties P)
 {
     using (cmdd = new SqlCommand())
     {
         cmdd.CommandType = CommandType.StoredProcedure;
         cmdd.CommandText = "sp_AdminInsertUpdate_ModificationForm_ChangeInCategory";
         cmdd.Connection  = getConnection.getconnection();
         cmdd.Parameters.AddWithValue("@inword", P.AdminInsertModificationForm_ChangeOfCategory_Inword);
         cmdd.Parameters.AddWithValue("@ConsumerNo", P.AdminInsertModificationForm_ChangeOfCategory_consumerno);
         cmdd.Parameters.AddWithValue("@NewCategory", P.AdminInsertModificationForm_ChangeOfCategory_category);
         cmdd.Parameters.AddWithValue("@kmcCategory", P.AdminInsertModificationForm_ChangeOfCategory_kmccategory);
         cmdd.Parameters.AddWithValue("@NewArea", P.AdminInsertModificationForm_ChangeOfCategory_area);
         cmdd.Parameters.AddWithValue("@NewCurrentCharges", P.AdminInsertModificationForm_ChangeOfCategory_currentcharges);
         cmdd.Parameters.AddWithValue("@NewOutstandingArrears", P.AdminInsertModificationForm_ChangeOfCategory_outstandingarrears);
         cmdd.Parameters.AddWithValue("@createdby", P.AdminInsertModificationForm_ChangeOfCategory_createdby);
         cmdd.Parameters.AddWithValue("@description", P.AdminInsertModificationForm_ChangeOfCategory_discription);
         cmdd.Parameters.AddWithValue("@impact", P.AdminInsertModificationForm_ChangeOfCategory_impact);
         cmdd.Parameters.AddWithValue("@difference", P.AdminInsertModificationForm_ChangeOfCategory_difference);
         cmdd.Parameters.AddWithValue("@differnceperc", P.AdminInsertModificationForm_ChangeOfCategory_differencepercentage);
         cmdd.Parameters.AddWithValue("@sq_ft", P.AdminInsertModificationForm_ChangeOfCategory_sqft);
         cmdd.Parameters.AddWithValue("@sq_yd", P.AdminInsertModificationForm_ChangeOfCategory_sqyd);
         cmdd.Parameters.AddWithValue("@Sqft_Sqyd", P.AdminInsertModificationForm_ChangeOfCategory_sqft_sqyd);
         cmdd.ExecuteNonQuery();
     }
 }
Beispiel #4
0
        private bool canPawnJump(properties piece)
        {
            int row = piece.row;
            int col = piece.col;

            if (currentColorTurn == "White")
            {
                if (piece.row > 1 && piece.col > 1 &&
                    getPiece(row - 1, col - 1).color == "Black" && getPiece(row - 2, col - 2).color == "Blank") // check jump to the left
                {
                    return(true);
                }
                if (col <= 6 && row > 1 &&
                    getPiece(row - 1, col + 1).color == "Black" && getPiece(row - 2, col + 2).color == "Blank") // check jump to the right
                {
                    return(true);
                }
            }
            else if (currentColorTurn == "Black")
            {
                if (col > 1 && row <= 6 &&
                    getPiece(row + 1, col - 1).color == "White" && getPiece(row + 2, col - 2).color == "Blank") // check jump to the left
                {
                    return(true);
                }
                if (col < 6 && row < 6 &&
                    getPiece(row + 1, col + 1).color == "White" && getPiece(row + 2, col + 2).color == "Blank") // check jump to the right
                {
                    return(true);
                }
            }
            return(false);
        }
        public JsonResult smartMove()
        {
            properties pieceToMove = null;

            //Check if a piece can Jump
            for (int i = 0; i < board.pieces.Count; i++)
            {
                string pieceColor = board.pieces[i].color;

                if (pieceColor == board.currentColorTurn)
                {
                    if (board.canJump(board.pieces[i]))
                    {
                        pieceToMove          = board.pieces[i];
                        computer.pieceToMove = pieceToMove;
                        computer.jump(pieceToMove);
                        break;
                    }
                }
            }

            //Now we have that piece which is PieceToMove or not. We gotta check that so.

            if (pieceToMove != null)
            {
                //Move it
            }
            else
            {
                computer.moveRandomPiece(board.pieces);
                //Move it
            }
            return(null);
        }
Beispiel #6
0
 public void AdminInsertUpdateChangeCategoryAddStorey(properties P)
 {
     using (cmdd = new SqlCommand())
     {
         cmdd.CommandType = CommandType.StoredProcedure;
         cmdd.CommandText = "sp_AdminInsertUpdate_ModificationForm_ChangeOfCategoryAndStorey";
         cmdd.Connection  = getConnection.getconnection();
         cmdd.Parameters.AddWithValue("@inword", P.AdminInsertModificationForm_ChangeOfCategoryAndSize_Inword);
         cmdd.Parameters.AddWithValue("@category", P.AdminInsertModificationForm_ChangeOfCategoryAndSize_category);
         cmdd.Parameters.AddWithValue("@kmccategory", P.AdminInsertModificationForm_ChangeOfCategoryAndSize_kmccategory);
         cmdd.Parameters.AddWithValue("@description", P.AdminInsertModificationForm_ChangeOfCategoryAndSize_description);
         cmdd.Parameters.AddWithValue("@Storey", P.AdminInsertModificationForm_ChangeOfCategoryAndSize_storey);
         cmdd.Parameters.AddWithValue("@current_Charge", P.AdminInsertModificationForm_ChangeOfCategoryAndSize_currentcharges);
         cmdd.Parameters.AddWithValue("@outstanding_Arrears", P.AdminInsertModificationForm_ChangeOfCategoryAndSize_outstandingarrears);
         cmdd.Parameters.AddWithValue("@difference", P.AdminInsertModificationForm_ChangeOfCategoryAndSize_difference);
         cmdd.Parameters.AddWithValue("@difference_percentage", P.AdminInsertModificationForm_ChangeOfCategoryAndSize_diffpercentage);
         cmdd.Parameters.AddWithValue("@createdby", P.AdminInsertModificationForm_ChangeOfCategoryAndSize_createdby);
         cmdd.Parameters.AddWithValue("@impact", P.AdminInsertModificationForm_ChangeOfCategoryAndSize_impact);
         cmdd.Parameters.AddWithValue("@consumer_no", P.AdminInsertModificationForm_ChangeOfCategoryAndSize_consumerno);
         cmdd.Parameters.AddWithValue("@sq_ft", P.AdminInsertModificationForm_ChangeOfCategoryAndSize_sqft);
         cmdd.Parameters.AddWithValue("@sq_yd", P.AdminInsertModificationForm_ChangeOfCategoryAndSize_sqyd);
         cmdd.Parameters.AddWithValue("@sqft_sqyd", P.AdminInsertModificationForm_ChangeOfCategoryAndSize_sqft_sqyd);
         cmdd.Parameters.AddWithValue("@area", P.AdminInsertModificationForm_ChangeOfCategoryAndSize_area);
         cmdd.ExecuteNonQuery();
     }
 }
    public static List <ListItem> SelectedBlock(int a, int b)
    {
        SqlConnection conn = new SqlConnection();

        conn.ConnectionString = ConfigurationManager.ConnectionStrings["kmcConnectionString"].ConnectionString;
        properties p = new properties();

        using (cmd = new SqlCommand("sp_SelectBlock", conn))
        {
            List <ListItem> div = new List <ListItem>();
            cmd.CommandType = CommandType.StoredProcedure;
            conn.Open();

            cmd.Parameters.AddWithValue("@ucid", a);
            cmd.Parameters.AddWithValue("@townid", b);

            using (SqlDataReader sdr = cmd.ExecuteReader())
            {
                while (sdr.Read())
                {
                    div.Add(new ListItem
                    {
                        Value = sdr[0].ToString(),
                        Text  = sdr[1].ToString()
                    });
                }
            }

            return(div);
        }
    }
        public static relationship NewRelationship(PropertyAndValue pavcIn)
        {
            relationship r = null;

            if (pavcIn.pValues[(int)CecilConst.PropertyName.Name] == null)
            {
                throw new ArgumentNullException(CecilConst.PropertyName.Name.ToString());
            }
            if (pavcIn.pValues[(int)CecilConst.PropertyName.FullName] == null)
            {
                throw new ArgumentNullException(CecilConst.PropertyName.FQName.ToString());
            }
            if (pavcIn.pValues[(int)CecilConst.PropertyName.ArchiMateElementType] == null)
            {
                throw new ArgumentNullException(CecilConst.PropertyName.ArchiMateElementType.ToString());
            }
            if (pavcIn.pValues[(int)CecilConst.PropertyName.APIType] == null)
            {
                throw new ArgumentNullException(CecilConst.PropertyName.APIType.ToString());
            }
            if (pavcIn.pValues[(int)CecilConst.PropertyName.SourceIdentifier] == null)
            {
                throw new ArgumentNullException(CecilConst.PropertyName.SourceIdentifier.ToString());
            }
            if (pavcIn.pValues[(int)CecilConst.PropertyName.TargetIdentifier] == null)
            {
                throw new ArgumentNullException(CecilConst.PropertyName.TargetIdentifier.ToString());
            }

            string label             = pavcIn.pValues[(int)CecilConst.PropertyName.Name];
            string fullname          = pavcIn.pValues[(int)CecilConst.PropertyName.FullName];
            string type              = pavcIn.pValues[(int)CecilConst.PropertyName.ArchiMateElementType];
            string eSourceIdentifier = pavcIn.pValues[(int)CecilConst.PropertyName.SourceIdentifier];
            string eTargetIdentifier = pavcIn.pValues[(int)CecilConst.PropertyName.TargetIdentifier];

            properties ps = ModelFactory.NewProperties();

            foreach (CecilConst.PropertyName pn in Enum.GetValues(typeof(CecilConst.PropertyName)))
            {
                if (pn == CecilConst.PropertyName.NumberOfItems)
                {
                    break;
                }

                int ipn = (int)pn;
                if (pavcIn.pValues[ipn] != null)
                {
                    property p = ModelFactory.NewProperty(ModelFactory.NewValue(pavcIn.pValues[ipn]), pdc[ipn]);
                    ps.property.Add(p);
                }
            }

            ModelConst.RelationshipType eType = (ModelConst.RelationshipType)Enum.Parse(typeof(ModelConst.RelationshipType), type);
            r = ModelFactory.NewRelationship(fullname, eType, eSourceIdentifier, eTargetIdentifier, ps);

            r.label.ElementAt(0).label_text = label; // short name for display; fullname to compute unique identifier

            return(r);
        }
        public ActionResult DeleteConfirmed(int id)
        {
            properties properties = db.properties.Find(id);

            db.properties.Remove(properties);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "property_id,type,city,country,built_year,number_of_rooms,area_size,price,image, address, postal, owned_by")] properties properties)
 {
     if (ModelState.IsValid)
     {
         db.Entry(properties).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(properties));
 }
Beispiel #11
0
    public static void Main()
    {
        properties P1 = new properties();

        P1.Id   = 4142;
        P1.Name = "Brajesh singh";

        Console.WriteLine("student id: {0}", P1.Id);
        Console.WriteLine("Student Name: {0}", P1.Name);
        Console.WriteLine("Passmark: {0}", P1.Passmark);
        Console.Read();
    }
Beispiel #12
0
    public static void Main( )
    {
        properties P1 = new properties();

        P1.SetId(4142);
        P1.SetName("Brajesh singh");

        Console.WriteLine("student id: {0}", P1.GetId());
        Console.WriteLine("Student Name: {0}", P1.GetName());
        Console.WriteLine("Passmark: {0}", P1.GetPassmark());
        Console.Read();
    }
Beispiel #13
0
    public void AdminBulkUploadAyshaManzil(properties P)
    {
        if (P.AdminBulkInsertAyshaManzil.PostedFile != null)
        {
            string path = string.Concat(System.Web.HttpContext.Current.Server.MapPath("~/UploadFile/" + P.AdminBulkInsertAyshaManzil.PostedFile.FileName));
            P.AdminBulkInsertAyshaManzil.PostedFile.SaveAs(path);

            string excelCS = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=Excel 8.0", path);

            using (con = new OleDbConnection(excelCS))
            {
                cmd = new OleDbCommand("select * from [Sheet1$]", con);
                con.Open();
                // Create DbDataReader to Data Worksheet
                dr = cmd.ExecuteReader();
                // SQL Server Connection String
                string CS = ConfigurationManager.ConnectionStrings["kmcConnectionString"].ConnectionString;



                ds  = new DataSet();
                oda = new OleDbDataAdapter("select * from [Sheet1$]", con);
                con.Close();//close Excel connection after adding to data set
                oda.Fill(ds);

                DataTable Exceldt = ds.Tables[0]; //copy data set to datatable

                for (int i = Exceldt.Rows.Count - 1; i >= 0; i--)
                {
                    string v = Exceldt.Rows[i][3].ToString();
                    if (Exceldt.Rows[i][3].ToString() == "Rebate Bill")
                    {
                        Exceldt.Rows[i].Delete();
                    }
                }

                Exceldt.AcceptChanges();


                bulkInsert = new SqlBulkCopy(CS);
                bulkInsert.DestinationTableName = "duplicatebill_history";
                //Mapping Table column
                bulkInsert.ColumnMappings.Add(Convert.ToInt16(0), Convert.ToInt16(1));
                bulkInsert.ColumnMappings.Add(Convert.ToInt16(1), Convert.ToInt16(2));
                bulkInsert.ColumnMappings.Add(Convert.ToInt16(2), Convert.ToInt16(5));
                bulkInsert.ColumnMappings.Add(Convert.ToInt16(3), Convert.ToInt16(6));
                bulkInsert.ColumnMappings.Add(Convert.ToInt16(4), Convert.ToInt16(3));
                bulkInsert.ColumnMappings.Add(Convert.ToInt16(5), Convert.ToInt16(4));
                bulkInsert.WriteToServer(Exceldt);
            }
        }
    }
        public static element NewElement(PropertyAndValue pavcIn)
        {
            element e = null;

            if (pavcIn.pValues[(int)CecilConst.PropertyName.Name] == null)
            {
                throw new ArgumentNullException(CecilConst.PropertyName.Name.ToString());
            }
            if (pavcIn.pValues[(int)CecilConst.PropertyName.FullName] == null)
            {
                throw new ArgumentNullException(CecilConst.PropertyName.FQName.ToString());
            }
            if (pavcIn.pValues[(int)CecilConst.PropertyName.ArchiMateElementType] == null)
            {
                throw new ArgumentNullException(CecilConst.PropertyName.ArchiMateElementType.ToString());
            }
            if (pavcIn.pValues[(int)CecilConst.PropertyName.APIType] == null)
            {
                throw new ArgumentNullException(CecilConst.PropertyName.APIType.ToString());
            }

            string label    = pavcIn.pValues[(int)CecilConst.PropertyName.Name];
            string fullname = pavcIn.pValues[(int)CecilConst.PropertyName.FullName];
            string type     = pavcIn.pValues[(int)CecilConst.PropertyName.ArchiMateElementType];

            //if (fullname.Contains("_annotations")) System.Diagnostics.Debugger.Break();

            properties ps = ModelFactory.NewProperties();

            foreach (CecilConst.PropertyName pn in Enum.GetValues(typeof(CecilConst.PropertyName)))
            {
                if (pn == CecilConst.PropertyName.NumberOfItems)
                {
                    break;
                }

                int ipn = (int)pn;
                if (pavcIn.pValues[ipn] != null)
                {
                    property p = ModelFactory.NewProperty(ModelFactory.NewValue(pavcIn.pValues[ipn]), pdc[ipn]);
                    ps.property.Add(p);
                }
            }

            ModelConst.ElementType eType = (ModelConst.ElementType)Enum.Parse(typeof(ModelConst.ElementType), type);
            e = ModelFactory.NewElement(fullname, eType, ps);

            e.label.ElementAt(0).label_text = label; // short name for display; fullname to compute unique identifier

            return(e);
        }
        // GET: Property/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            properties properties = db.properties.Find(id);

            if (properties == null)
            {
                return(HttpNotFound());
            }
            return(View(properties));
        }
Beispiel #16
0
 public properties getEatenPiece(properties piece, moveC move)
 {
     //Going to top.
     if (move.row < piece.row)
     {
         //If Diagonal to the right do.. else...
         return(move.col > piece.col ? getPiece(move.row + 1, move.col - 1):getPiece(move.row + 1, move.col + 1));
     }
     //Going to bottom.
     else
     {
         //If Diagonal to the right  do.. else..
         return(move.col > piece.col ? getPiece(move.row - 1, move.col - 1) : getPiece(move.row - 1, move.col + 1));
     }
 }
Beispiel #17
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.R))
        {
            properties woodScript  = GameObject.Find("LvlWood").GetComponent <properties>();
            properties waterScript = GameObject.Find("LvlWater").GetComponent <properties>();
            properties earthScript = GameObject.Find("LvlEarth").GetComponent <properties>();
            properties metalScript = GameObject.Find("LvlMetal").GetComponent <properties>();
            properties fireScript  = GameObject.Find("LvlFire").GetComponent <properties>();

            woodScript.level--;
            waterScript.level--;
            earthScript.level--;
            metalScript.level--;
            fireScript.level--;
        }
    }
Beispiel #18
0
        private void openBudget(string fileName)
        {
            var formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();

            System.IO.FileStream fs = new System.IO.FileStream(fileName, System.IO.FileMode.Open);
            props        = (properties)formatter.Deserialize(fs);
            myProperties = (CustomClass)formatter.Deserialize(fs);
            fs.Close();
            openFileName                  = System.IO.Path.GetFileName(fileName);
            propGrid.SelectedObject       = props;
            propGridCustom.SelectedObject = myProperties;

            props.removeEventHandlers();
            props.addEventHandlers();

            fillTotalValues(props);
            this.Title = string.Format("{0} - Otthoni költségvetéskezelő", openFileName);
        }
Beispiel #19
0
        private void filterupdate() // enable specific boxes
        {
            disableAll();
            if (filter_type.SelectedIndex > 0)
            {
                string uuid = ((Item)filter_type.SelectedItem).UUID.ToString();
                if (Database.blocks.ContainsKey(uuid) && Database.blocks[uuid] is Part)
                {
                    properties property = ((Part)Database.blocks[uuid]).GetProperty();
                    if (property == properties.sensor)
                    {
                        Edit_sensor.Visibility = Visibility.Visible;
                    }
                    if (property == properties.spotlight)
                    {
                        Edit_lamp.Visibility = Visibility.Visible;
                    }
                    if (property == properties.logic)
                    {
                        Edit_gate.Visibility = Visibility.Visible;
                    }
                    if (property == properties.timer)
                    {
                        Edit_Timer.Visibility = Visibility.Visible;
                    }
                }
            }
            Edit_general.Visibility = Visibility.Visible;
            int x1 = Convert.ToInt32(filter_x1.Text);
            int y1 = Convert.ToInt32(filter_y1.Text);
            int z1 = Convert.ToInt32(filter_z1.Text);
            int x2 = Convert.ToInt32(filter_x2.Text);
            int y2 = Convert.ToInt32(filter_y2.Text);
            int z2 = Convert.ToInt32(filter_z2.Text);

            this.mainwindow.setMarker2((x1 + x2 + 0.0f) / 2, (y1 + y2 + 0.0f) / 2, (z1 + z2 + 0.0f) / 2, (x2 - x1), (y2 - y1), (z2 - z1));

            button_render.IsEnabled = true;
        }
Beispiel #20
0
 public void AdminInsertUpdateDeleteConsumer(properties P)
 {
     using (cmdd = new SqlCommand())
     {
         cmdd.CommandType = CommandType.StoredProcedure;
         cmdd.CommandText = "sp_AdminInsertUpdate_ModificationForm_DeleteConsumer";
         cmdd.Connection  = getConnection.getconnection();
         cmdd.Parameters.AddWithValue("@inword", P.AdminInsertDeleteConsumer_Inwordno);
         cmdd.Parameters.AddWithValue("@inword_modifyimpact", P.AdminInsertDeleteConsumer_InwordnoForModifyImpact);
         cmdd.Parameters.AddWithValue("@consumer_no", P.AdminInsertDeleteConsumer_Consumerno);
         cmdd.Parameters.AddWithValue("@consumer_no_deleteconsumer", P.AdminInsertDeleteConsumer_ConsumernoDeleteConsumer);
         cmdd.Parameters.AddWithValue("@consumer_no_consumer", P.AdminInsertDeleteConsumer_ConsumernoConsumer);
         cmdd.Parameters.AddWithValue("@modification_status", P.AdminInsertDeleteConsumer_ModificationStatus);
         cmdd.Parameters.AddWithValue("@modification_status_modifyimpact", P.AdminInsertDeleteConsumer_ModificationStatusModifyImpact);
         cmdd.Parameters.AddWithValue("@createdby", P.AdminInsertDeleteConsumer_Createdby);
         cmdd.Parameters.AddWithValue("@createdby_modifyimpact", P.AdminInsertDeleteConsumer_CreatedbyModifyImpact);
         cmdd.Parameters.AddWithValue("@description", P.AdminInsertDeleteConsumer_Description);
         cmdd.Parameters.AddWithValue("@description_modifyimpact", P.AdminInsertDeleteConsumer_DescriptionModifyImpact);
         cmdd.Parameters.AddWithValue("@impact", P.AdminInsertDeleteConsumer_Impact);
         cmdd.ExecuteNonQuery();
     }
 }
Beispiel #21
0
        private void fillTotalValues(properties props)
        {
            TotalValues.Collection.Clear(); //don't want duplicate elements
            #region TotalValues members
            var tv1 = new TotalValues("Leisure", props.leisure.totalLeisure, "Szórakozás");
            //   var tv2 = new TotalValues("Income", props.totalIncome, "Bevétel");
            var tv3  = new TotalValues("Media", props.media.TotalMedia, "Média");
            var tv4  = new TotalValues("Housing", props.housing.TotalHousing, "Lakhatás");
            var tv5  = new TotalValues("PublicUtils", props.publicUtils.TotalPublicUtils, "Közművek");
            var tv6  = new TotalValues("Transportation", props.transportation.TotalTransportation, "Közlekedés");
            var tv7  = new TotalValues("Household", props.household.TotalHousehold, "Háztartás");
            var tv8  = new TotalValues("Foods", props.food.TotalFoods, "Élelmiszer");
            var tv9  = new TotalValues("Children", props.children.TotalChildren, "Gyermekek");
            var tv10 = new TotalValues("Savings", props.savings.TotalSavings, "Megtakarítások");
            var tv11 = new TotalValues("Insurances", props.insurances.TotalInsurances, "Biztosítások");
            var tv12 = new TotalValues("Others", props.others.TotalOthers, "Egyéb kiadások");

            propGrid.Refresh();
            propGridCustom.Refresh();
            var customCollection = new TotalValues("Custom", myProperties.TotalValue, "Saját kiadások");

            TotalValues.Collection.Add(tv1);
            TotalValues.Collection.Add(customCollection);   //tv2
            TotalValues.Collection.Add(tv3);
            TotalValues.Collection.Add(tv4);
            TotalValues.Collection.Add(tv5);
            TotalValues.Collection.Add(tv6);
            TotalValues.Collection.Add(tv7);
            TotalValues.Collection.Add(tv8);
            TotalValues.Collection.Add(tv9);
            TotalValues.Collection.Add(tv10);
            TotalValues.Collection.Add(tv11);
            TotalValues.Collection.Add(tv12);

            #endregion

            updateLabels();
        }
Beispiel #22
0
        private bool canCrownJump(properties piece)
        {
            int col = piece.col;
            int row = piece.row;

            string opponent;

            if (currentColorTurn == "White")
            {
                opponent = "Black";
            }
            else
            {
                opponent = "White";
            }
            if (col > 1 && row > 1 &&
                getPiece(row - 1, col - 1).color == opponent && getPiece(row - 2, col - 2).color == "Blank") // check jump to the left
            {
                return(true);
            }
            if (col < 6 && row > 1 &&
                getPiece(row - 1, col + 1).color == opponent && getPiece(row - 2, col + 2).color == "Blank") // check jump to the right
            {
                return(true);
            }
            if (col > 1 && row < 6 &&
                getPiece(row + 1, col - 1).color == opponent && getPiece(row + 2, col - 2).color == "Blank") // check jump to the left
            {
                return(true);
            }
            if (col < 6 && row < 6 &&
                getPiece(row + 1, col + 1).color == opponent && getPiece(row + 2, col + 2).color == "Blank") // check jump to the right
            {
                return(true);
            }
            return(false);
        }
Beispiel #23
0
                // presence

                public Data()
                {
                    properties = new properties();
                }
Beispiel #24
0
 public static DiagnosticReporter CreateForLocation(Location location, Action <Diagnostic> reportDiagnostic) => new((descriptor, properties, args) => reportDiagnostic(location.CreateDiagnostic(descriptor, properties, args)));
Beispiel #25
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                ReceivedItemsLogic ameh = new ReceivedItemsLogic();
                properties         RecievedItemsOrderObject = new properties();

                if (tbOtEONumber.Text == "")
                {
                    panelError.Visible   = true;
                    lblError.Text        = "OTEO Number Cannot be Blank.";
                    panelSuccess.Visible = false;
                    return;
                }
                else
                {
                    RecievedItemsOrderObject.ReceivedItemsOTEOID = Convert.ToInt32(tbOtEONumber.Text);
                }



                RecievedItemsOrderObject.Date = DateTime.ParseExact(tbOTEODate.Text, "dd-MM-yyyy", null).ToString("yyyy-MM-dd");


                if (tbSupplyOrderReference.Text == "")
                {
                    panelError.Visible   = true;
                    lblError.Text        = "Supply Order Reference Cannot be Blank.";
                    panelSuccess.Visible = false;
                    tbSupplyOrderReference.Focus();
                    return;
                }
                else
                {
                    RecievedItemsOrderObject.SupplyOderRef = tbSupplyOrderReference.Text;
                }



                RecievedItemsOrderObject.SupplyDate = DateTime.ParseExact(tbSupplyDate.Text, "dd-MM-yyyy", null).ToString("yyyy-MM-dd");



                if (tbSupplierName.Text == "")
                {
                    panelError.Visible   = true;
                    lblError.Text        = "Supplier Name  Cannot be Blank.";
                    panelSuccess.Visible = false;
                    tbSupplierName.Focus();
                    return;
                }
                else
                {
                    RecievedItemsOrderObject.Supplier = tbSupplierName.Text;
                }


                if (ddlIssueHead.SelectedValue == "")
                {
                    panelError.Visible   = true;
                    lblError.Text        = "Should Select Issue Heads.";
                    panelSuccess.Visible = false;
                    return;
                }
                else
                {
                    RecievedItemsOrderObject.IssueHeadName = ddlIssueHead.SelectedItem.ToString();
                }

                if (ddlChargeableHead.SelectedItem.ToString() == "--Select Chargeable Head--")
                {
                    panelError.Visible   = true;
                    lblError.Text        = "Should Select Chargeable Heads.";
                    panelSuccess.Visible = false;
                    return;
                }
                else
                {
                    RecievedItemsOrderObject.ChargeableHeadName = ddlChargeableHead.SelectedItem.ToString();
                }



                TextBox tbtotalAmount = gvItems.FooterRow.FindControl("tbtotalAmount") as TextBox;
                RecievedItemsOrderObject.TotalAmount = Convert.ToDouble(tbtotalAmount.Text);
                //setting user id temp here
                // Session["USERID"] = 1;
                RecievedItemsOrderObject.ModifiedBy = Convert.ToInt16(Session["USERID"]);
                //getting all the values of controls values inside gridview control

                StringBuilder sb = new StringBuilder();


                //  sb.Append("<root>");

                string insertStatement = "INSERT INTO ReceivedItemsDetails(RECEIVEDITEMSOTEOID,ITEMID, ITEMNAME,QUANTITY,UNIT,RATE, AMOUNT) values('@RECEIVEDITEMSOTEOID','@ITEMID', '@ITEMNAME', '@QUANTITY', '@UNIT', '@RATE', '@AMOUNT')";

                string insertRateMaster = "INSERT into ItemsRateMaster (itemname,MaxOrderNO,IssueHeadName) values('@ITEMNAME','@odNo','@issueHead')";
                string UpdateRateMaster = "update ItemsRateMaster set MaxOrderNO='@odNo' where itemname='@ITEMNAME' AND IssueHeadName='@issueHead'";


                string insertRateSecondary = "INSERT into ItemsRateSecondary (ITEMNAME,Rate,OrderNO,Quantity,IssueHeadName) values('@ITEMNAME','@RATE','@odNo','@QUANTITY','@issueHead')";
                //string updateRateSecondary = "update ItemsRateSecondary set ITEMNAME,Rate,OrderNO,Quantity,IssueHeadName) values('@ITEMNAME','@RATE','@odNo','@QUANTITY','@issueHead')";


                for (int i = 0; i < gvItems.Rows.Count; i++)
                {
                    // TextBox tbItemID = gvItems.Rows[i].FindControl("tbItemID") as TextBox;

                    HiddenField  hdnFieldItemID = gvItems.Rows[i].FindControl("_hdnFieldItemID") as HiddenField;
                    DropDownList itemName       = gvItems.Rows[i].FindControl("_ddItems") as DropDownList;
                    TextBox      _tbUnit        = gvItems.Rows[i].FindControl("_tbUnit") as TextBox;
                    // Label lblUnit = gvItems.Rows[i].FindControl("lblUnit") as Label;

                    TextBox tbOrderNo = gvItems.Rows[i].FindControl("_tbOrderNo") as TextBox;

                    TextBox tbQuantity = gvItems.Rows[i].FindControl("_tbQuantity") as TextBox;
                    TextBox tbRate     = gvItems.Rows[i].FindControl("tbRate") as TextBox;
                    TextBox tbAmount   = gvItems.Rows[i].FindControl("tbAmount") as TextBox;
                    // Label lblAmount = gvItems.Rows[i].FindControl("lblAmount") as Label;

                    //CODE TO CHECK NULL VALUES
                    CheckExistingItem = tbOrderNo.Text;
                    //SAVE CODE
                    if (itemName.SelectedValue.ToString() != "0")
                    {
                        double result;
                        if (!double.TryParse(tbQuantity.Text, out result))
                        {
                            panelError.Visible   = true;
                            lblError.Text        = "Should Be Numeric";
                            panelSuccess.Visible = false;
                            tbQuantity.Focus();
                            tbQuantity.Style.Add("background", "Pink");
                            return;
                        }
                        else
                        {
                            tbQuantity.Style.Add("background", "White");
                        }

                        double result1;
                        if (!double.TryParse(tbRate.Text, out result1))
                        {
                            panelError.Visible   = true;
                            lblError.Text        = "Should Be Numeric";
                            panelSuccess.Visible = false;
                            tbRate.Focus();
                            tbRate.Style.Add("background", "Pink");
                            return;
                        }
                        else
                        {
                            tbRate.Style.Add("background", "White");
                        }


                        sb.Append(insertStatement.Replace("@RECEIVEDITEMSOTEOID", tbOtEONumber.Text).Replace("@ITEMID", hdnFieldItemID.Value).Replace("@ITEMNAME", Utilities.ValidSql(itemName.SelectedItem.ToString())).Replace("@QUANTITY", tbQuantity.Text).Replace("@UNIT", _tbUnit.Text).Replace("@RATE", tbRate.Text).Replace("@AMOUNT", tbAmount.Text));

                        if (CheckExistingItem == "1")
                        {
                            sb.Append(insertRateMaster.Replace("@ITEMNAME", Utilities.ValidSql(itemName.SelectedItem.ToString())).Replace("@odNo", tbOrderNo.Text).Replace("@issueHead", ddlIssueHead.SelectedItem.ToString()));
                            sb.Append(insertRateSecondary.Replace("@ITEMNAME", Utilities.ValidSql(itemName.SelectedItem.ToString())).Replace("@RATE", tbRate.Text).Replace("@odNo", tbOrderNo.Text).Replace("@QUANTITY", tbQuantity.Text).Replace("@issueHead", ddlIssueHead.SelectedItem.ToString()));
                        }
                        else
                        {
                            sb.Append(UpdateRateMaster.Replace("@ITEMNAME", Utilities.ValidSql(itemName.SelectedItem.ToString())).Replace("@odNo", tbOrderNo.Text).Replace("@issueHead", ddlIssueHead.SelectedItem.ToString()));
                            sb.Append(insertRateSecondary.Replace("@ITEMNAME", Utilities.ValidSql(itemName.SelectedItem.ToString())).Replace("@RATE", tbRate.Text).Replace("@odNo", tbOrderNo.Text).Replace("@QUANTITY", tbQuantity.Text).Replace("@issueHead", ddlIssueHead.SelectedItem.ToString()));
                        }
                    }
                }
                //now save it to db
                //making sure sb string is not empty
                if (sb.ToString() != "")
                {
                    ameh.SaveReceivedItemsDetails(RecievedItemsOrderObject, sb.ToString());

                    Session["OTEONUMBER"] = tbOtEONumber.Text;
                    Response.Redirect("ReceivedEntriesList.aspx");
                }

                else
                {
                    panelError.Visible   = true;
                    lblError.Text        = "Error! Select atleast one item to add.";
                    panelSuccess.Visible = false;
                }
            }
            catch (SqlException ex)
            {
                if (ex.Message.Contains("duplicate key"))
                {
                    panelError.Visible       = true;
                    lblError.Text            = "Error! The OTEO ID already exists. Please use another ID";
                    panelSuccess.Visible     = false;
                    tbOtEONumber.BorderColor = System.Drawing.Color.Red;
                }
                else
                {
                    Session["ERRORMSG"] = ex.ToString();
                    Response.Redirect("Error.aspx");
                }
            }

            catch (System.Threading.ThreadAbortException)
            {
                //do nothing
            }

            catch (Exception ex)
            {
                panelError.Visible   = true;
                lblError.Text        = ex.Message;
                panelSuccess.Visible = false;
            }
        }
Beispiel #26
0
        private void _Save()
        {
            try
            {
                IsssuedItemsLogic akivi  = new IsssuedItemsLogic();
                properties        issued = new properties();

                issued.ChallanID            = Convert.ToDecimal(_tbChalanNo.Text);
                issued.Date                 = _tbChallanDate.Text;
                issued.IndentValue          = _tbIndentValue.Text;
                issued.Date2                = _tbIntendDate.Text;
                issued.Division             = _ddIntendDivisions.Text;
                issued.ChargeableHeadName   = _ddCHead.SelectedItem.ToString();
                issued.IsDeliveredTemporary = istemporary.Checked ? "Yes" : "No";
                issued.ModifiedBy           = Convert.ToInt16(Session["USERID"]);

                StringBuilder sb = new StringBuilder();
                string        insertStatement = "INSERT INTO DeliveryItemsDetails(DeliveryItemsChallanID,ItemName, IssueHeadName,QUANTITY,UNIT,RATE) values('@DeliveryItemsChallanID','@ItemName', '@IssueHeadName', '@QUANTITY', '@UNIT', '@RATE')";
                for (int i = 0; i < gvItems.Rows.Count; i++)
                {
                    DropDownList itemName     = gvItems.Rows[i].FindControl("_ddItems") as DropDownList;
                    TextBox      itemUnit     = gvItems.Rows[i].FindControl("_tbUnit") as TextBox;
                    TextBox      itemQuantity = gvItems.Rows[i].FindControl("_tbQuantity") as TextBox;
                    DropDownList itemIHead    = gvItems.Rows[i].FindControl("_ddIhead") as DropDownList;
                    DropDownList ddlRates     = gvItems.Rows[i].FindControl("ddlRates") as DropDownList;

                    if (itemName.SelectedValue.ToString() != "")
                    {
                        sb.Append(insertStatement.Replace("@DeliveryItemsChallanID", _tbChalanNo.Text).Replace("@ItemName", Utilities.ValidSql(itemName.SelectedItem.ToString())).Replace("@IssueHeadName", itemIHead.SelectedItem.ToString()).Replace("@QUANTITY", itemQuantity.Text).Replace("@UNIT", itemUnit.Text).Replace("@RATE", ddlRates.Text));
                        totalAmount += Convert.ToDouble(itemQuantity.Text) * Convert.ToDouble(ddlRates.SelectedValue);
                    }
                }
                issued.TotalAmount = totalAmount;
                //now save it to db
                //making sure sb string is not empty
                if (sb.ToString() != "")
                {
                    // //call the method to save both in primary deliverychallan table and delivery details table
                    akivi.SaveIssuedItems(issued, sb.ToString());
                    //Session["CHALLANNO"] = _tbChalanNo.Text;
                    _tbChalanNo.Text = (Convert.ToDouble(_tbChalanNo.Text) + 1).ToString();
                    //to continue with same
                    //   Response.Redirect("IssueEntriesList.aspx");
                }


                else
                {
                    panelError.Visible   = true;
                    lblError.Text        = "Error! Select atleast one item to add.";
                    panelSuccess.Visible = false;
                }
            }

            catch (System.Threading.ThreadAbortException)
            {
                //do nothing
            }
            catch (SqlException ex)
            {
                if (ex.Message.Contains("duplicate key"))
                {
                    panelError.Visible   = true;
                    lblError.Text        = "Error! The challan ID already exists. Please use another ID";
                    panelSuccess.Visible = false;
                    // tbOtEONumber.BorderColor = System.Drawing.Color.Red;
                }
                else
                {
                    Session["ERRORMSG"] = ex.ToString();
                    Response.Redirect("Error.aspx");
                }
            }
            catch (Exception ex)
            {
                Session["ERRORMSG"] = ex.ToString();
                Response.Redirect("Error.aspx", true);
            }
        }
        protected void _btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                IsssuedItemsLogic akivi  = new IsssuedItemsLogic();
                properties        issued = new properties();

                decimal orginalChallanID = Convert.ToDecimal(hdnFieldChallanID.Value);

                issued.ChallanID = Convert.ToDecimal(_tbChalanNo.Text);
                // issued.Date = _tbChallanDate.Text;
                issued.Date = DateTime.ParseExact(_tbChallanDate.Text, "dd-MM-yyyy", null).ToString("yyyy-MM-dd");
                stDate      = DateTime.ParseExact(_tbChallanDate.Text, "dd-MM-yyyy", null).ToString("yyyy-MM-dd");

                issued.IndentValue = _tbIndentValue.Text;
                // issued.Date2 = _tbIntendDate.Text;

                issued.Date2 = DateTime.ParseExact(_tbIntendDate.Text, "dd-MM-yyyy", null).ToString("yyyy-MM-dd");

                edDate = DateTime.ParseExact(_tbIntendDate.Text, "dd-MM-yyyy", null).ToString("yyyy-MM-dd");

                if (_ddIntendDivisions.SelectedIndex > 0)
                {
                    issued.Division = _ddIntendDivisions.Text;
                }
                else
                {
                    issued.Division = lblDivisionOld.Text;
                }

                if (_ddCHead.SelectedIndex > 0)
                {
                    issued.ChargeableHeadName = _ddCHead.SelectedItem.ToString();
                }
                else
                {
                    issued.ChargeableHeadName = lblChHeadOld.Text;
                }

                issued.IsDeliveredTemporary = istemporary.Checked ? "Yes" : "No";
                issued.ModifiedBy           = Convert.ToInt16(Session["USERID"]);
                issued.ReceiverDesignation  = tbReceiverDesignation.Text;
                issued.VehicleNumber        = tbVehicleNumberCaps.Text.ToUpper();
                issued.Remarks = tbremarks.Text;


                StringBuilder sb = new StringBuilder();
                string        insertStatement = "INSERT INTO DeliveryItemsDetails(DeliveryItemsChallanID,ItemName, IssueHeadName,QUANTITY,UNIT,RATE) values('@DeliveryItemsChallanID','@ItemName', '@IssueHeadName', '@QUANTITY', '@UNIT', '@RATE')";
                for (int i = 0; i < gvItems.Rows.Count; i++)
                {
                    DropDownList itemName     = gvItems.Rows[i].FindControl("_ddItems") as DropDownList;
                    TextBox      itemUnit     = gvItems.Rows[i].FindControl("_tbUnit") as TextBox;
                    TextBox      itemQuantity = gvItems.Rows[i].FindControl("_tbQuantity") as TextBox;

                    //DropDownList itemIHead = gvItems.Rows[i].FindControl("_ddIhead") as DropDownList;
                    //DropDownList ddlRates = gvItems.Rows[i].FindControl("ddlRates") as DropDownList;

                    HiddenField hdnSelectedIssueHead = gvItems.Rows[i].FindControl("hdnSelectedIssueHead") as HiddenField;
                    HiddenField hdnSelectedRate      = gvItems.Rows[i].FindControl("hdnSelectedRate") as HiddenField;


                    if (itemName.SelectedValue.ToString() != "")
                    {
                        sb.Append(insertStatement.Replace("@DeliveryItemsChallanID", _tbChalanNo.Text).Replace("@ItemName", Utilities.ValidSql(itemName.SelectedItem.ToString())).Replace("@IssueHeadName", hdnSelectedIssueHead.Value).Replace("@QUANTITY", itemQuantity.Text).Replace("@UNIT", itemUnit.Text).Replace("@RATE", hdnSelectedRate.Value));
                    }
                }
                if (sb.ToString() != "")
                {
                    akivi.UpdateIssuedItems(issued, orginalChallanID, sb.ToString());
                }
                else
                {
                    akivi.UpdateIssuedItems(issued, orginalChallanID);
                }

                Response.Redirect("~/Admin/IssueEntriesList.aspx");
            }

            catch (System.Threading.ThreadAbortException)
            {
            }
            catch (SqlException ex)
            {
                if (ex.Message.Contains("duplicate key"))
                {
                    panelError.Visible   = true;
                    lblError.Text        = "Error! The challan ID already exists. Please use another ID";
                    panelSuccess.Visible = false;
                }
                else
                {
                    Session["ERRORMSG"] = ex.ToString();
                    Response.Redirect("Error.aspx");
                }
            }
            catch (Exception ex)
            {
                Session["ERRORMSG"] = ex.ToString();
                Response.Redirect("Error.aspx", true);
            }
        }
        protected void _btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                IsssuedItemsLogic akivi  = new IsssuedItemsLogic();
                properties        issued = new properties();

                decimal orginalChallanID = Convert.ToDecimal(hdnFieldChallanID.Value);

                issued.ChallanID = Convert.ToDecimal(_tbChalanNo.Text);

                // issued.Date = _tbChallanDate.Text;
                issued.Date = DateTime.ParseExact(_tbChallanDate.Text, "dd-MM-yyyy", null).ToString("yyyy-MM-dd");

                stDate = DateTime.ParseExact(_tbChallanDate.Text, "dd-MM-yyyy", null).ToString("yyyy-MM-dd");

                issued.IndentValue = _tbIndentValue.Text;
                // issued.Date2 = _tbIntendDate.Text;

                issued.Date2 = DateTime.ParseExact(_tbIntendDate.Text, "dd-MM-yyyy", null).ToString("yyyy-MM-dd");

                edDate = DateTime.ParseExact(_tbIntendDate.Text, "dd-MM-yyyy", null).ToString("yyyy-MM-dd");

                //using 2 controls for displaying old value and for givng option to check
                if (_ddIntendDivisions.SelectedIndex > 0)
                {
                    issued.Division = _ddIntendDivisions.Text;
                }
                else
                {
                    issued.Division = lblDivisionOld.Text; //same old value populated
                }
                //same wiht chargeable head value
                if (_ddCHead.SelectedIndex > 0)
                {
                    issued.ChargeableHeadName = _ddCHead.SelectedItem.ToString();
                }
                else
                {
                    issued.ChargeableHeadName = lblChHeadOld.Text;
                }

                issued.IsDeliveredTemporary = istemporary.Checked ? "Yes" : "No";
                issued.ModifiedBy           = Convert.ToInt16(Session["USERID"]);
                //if data is saved in challan table , save into item table
                StringBuilder sb = new StringBuilder();
                //  sb.Append("<root>");
                issued.VehicleNumber       = tbVehicleNumberCaps.Text;
                issued.ReceiverDesignation = tbReceiverDesignation.Text;
                issued.Remarks             = tbremarks.Text;

                string insertStatement = "INSERT INTO DeliveryItemsDetails(DeliveryItemsChallanID,ItemName, IssueHeadName,QUANTITY,UNIT,RATE) values('@DeliveryItemsChallanID','@ItemName', '@IssueHeadName', '@QUANTITY', '@UNIT', '@RATE')";
                for (int i = 0; i < gvItems.Rows.Count; i++)
                {
                    //TextBox itemID = gvItems.Rows[i].FindControl("_tbItemID") as TextBox;
                    DropDownList itemName     = gvItems.Rows[i].FindControl("_ddItems") as DropDownList;
                    TextBox      itemUnit     = gvItems.Rows[i].FindControl("_tbUnit") as TextBox;
                    TextBox      itemQuantity = gvItems.Rows[i].FindControl("_tbQuantity") as TextBox;
                    //DropDownList itemIHead = gvItems.Rows[i].FindControl("_ddIhead") as DropDownList;
                    //DropDownList ddlRates = gvItems.Rows[i].FindControl("ddlRates") as DropDownList;

                    HiddenField hdnSelectedIssueHead = gvItems.Rows[i].FindControl("hdnSelectedIssueHead") as HiddenField;
                    HiddenField hdnSelectedRate      = gvItems.Rows[i].FindControl("hdnSelectedRate") as HiddenField;
                    //SAVE CODE
                    if (itemName.SelectedValue.ToString() != "")
                    {
                        sb.Append(insertStatement.Replace("@DeliveryItemsChallanID", _tbChalanNo.Text).Replace("@ItemName", Utilities.ValidSql(itemName.SelectedItem.ToString())).Replace("@IssueHeadName", hdnSelectedIssueHead.Value).Replace("@QUANTITY", itemQuantity.Text).Replace("@UNIT", itemUnit.Text).Replace("@RATE", hdnSelectedRate.Value));
                    }
                }
                //now save it to db
                //making sure sb string is not empty
                if (sb.ToString() != "")
                {
                    //call the method to save both in primary deliverychallan table and delivery details table
                    akivi.UpdateIssuedItems(issued, orginalChallanID, sb.ToString());
                }
                //what if user doesn't require to add items but to change primary table details only



                else //else new item(s) not inserted...save only primary table
                {
                    akivi.UpdateIssuedItems(issued, orginalChallanID);
                    // panelError.Visible = true;
                    // lblError.Text = "Error! Select atleast one item to add.";
                    // panelSuccess.Visible = false;
                }
                Session["CHALLANNO"] = _tbChalanNo.Text;
                // Response.Redirect(Request.Url.ToString());
                Response.Redirect("~/Admin/IssuedEntryEdit.aspx?challanid=" + _tbChalanNo.Text);
            }

            catch (System.Threading.ThreadAbortException)
            {
                //do nothing
            }
            catch (SqlException ex)
            {
                if (ex.Message.Contains("duplicate key"))
                {
                    panelError.Visible   = true;
                    lblError.Text        = "Error! The challan ID already exists. Please use another ID";
                    panelSuccess.Visible = false;
                }
                else
                {
                    Session["ERRORMSG"] = ex.ToString();
                    Response.Redirect("Error.aspx");
                }
            }
            catch (Exception ex)
            {
                Session["ERRORMSG"] = ex.ToString();
                Response.Redirect("Error.aspx", true);
            }
        }
Beispiel #29
0
 public double getValue(properties p)
 {
     return(pGetValue((int)p));
 }
Beispiel #30
0
    // Use this for initialization

    void Awake()
    {
        timeAdjust   = 30f;
        prop_manager = gameObject.AddComponent <properties>() as properties;
    }